Welcome Guest, Not a member yet? Register   Sign In
Error uploading PDF

Hi everyone.

i have problem when trying to upload pdf, it always say : "The filetype you are attempting to upload is not allowed."

then i put
echo $_FILES['userfile']['type']
, it return : image/ipeg

Hope you guys help me..

first use another pdf file to upload if you are facing same problem then you have to add file type in CI mimes.php file


search pdf

replace the following with exiting one in pdf

array('application/pdf', 'application/x-download','image/ipeg')

Also, if you're specifying an array in your file uploading library config for allowed types, put PDF at the start.

thanks for the suggestion, i found the problem is my browser (im using firefox+palemoon), i dont know exactly why palemoon read it as image/ipeg , when im using chrome it works well.

Thanks guys

I had a similar problem while trying to upload a PDF. My 'allowed_filetypes' setting was:

$file_config['allowed_types'] = 'jpg|doc|gif|pdf|xls|png|zip|ai|psd|txt|rtf|htm|html|eml';

As mattpointblank suggested I put the 'pdf' type at the beginning as such:

$file_config['allowed_types'] = 'pdf|jpg|doc|gif|xls|png|zip|ai|psd|txt|rtf|htm|html|eml';

and now it works.

Another note is that this worked fine before moving my app to a new server. I do not know what the difference is. I do know that I used the same browser/version for both servers though.

Hi to all I also get same error for uploading pdf files.
when I try using opera 10 it work properly. but when I use
firefox 3.5 it was getting error. and my mimes.php contain
'pdf'    =>    array('application/pdf', 'application/x-download'),
'pdf' =>  array('application/pdf', 'application/x-pdf', 'application/x-download'),
'pdf'   =>  array('application/pdf', 'application/x-download', 'application/unknown'),
'pdf'   =>  array('application/pdf', 'application/x-pdf', 'application/x-download','binary/octet-stream', 'application/unknown', 'application/force-download'),
that mean i was try one by one above pdf configurations.
but it getting the same error.
please solve me this problem.
Thank you.

Theme © iAndrew 2016 - Forum software by © MyBB