Welcome Guest, Not a member yet? Register   Sign In
codeigniter upload 3gp or mp4 files doesnt work
#1

[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();
#2

[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.
#3

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

[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.
#5

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




Theme © iAndrew 2016 - Forum software by © MyBB