CodeIgniter Forums
codeigniter upload 3gp or mp4 files doesnt work - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: codeigniter upload 3gp or mp4 files doesnt work (/thread-44126.html)



codeigniter upload 3gp or mp4 files doesnt work - El Forum - 08-04-2011

[eluser]technology.guy[/eluser]
hi I am trying to upload 3gp and mp4 files on code igniter and it doesnt work

the mpg files are uploaded fine using the same code could anyone help me with that I will really appreciate that

Here is the code i am using

$config = array(
'allowed_types' => 'mp4|mp4|3gp',
'file_name' => 'video',
'max_size' => 1000,
'upload_path' => realpath(APPPATH.'../user_uploads/'),
);

$this->load->library('upload',$config);

$this->upload->do_upload();


$user_upload = $this->upload->data();


codeigniter upload 3gp or mp4 files doesnt work - El Forum - 08-04-2011

[eluser]jamesf[/eluser]
You'll probably have to add the extensions & mimetypes to the /application/config/mimes.php file for the upload class to recognise them.


codeigniter upload 3gp or mp4 files doesnt work - El Forum - 08-04-2011

[eluser]technology.guy[/eluser]
could you please tell me how to do that for mp4 and 3gp files??


codeigniter upload 3gp or mp4 files doesnt work - El Forum - 08-04-2011

[eluser]jamesf[/eluser]
Adding these to the $mimes array should do it:

Code:
'mp4' => 'video/mp4',
'3gp' => 'video/3gpp',

If not you'll have to print_r($_FILES) to see what mimetype the files are and replace them accordingly.


codeigniter upload 3gp or mp4 files doesnt work - El Forum - 08-04-2011

[eluser]technology.guy[/eluser]
Thanks a lot