CodeIgniter Forums
Error uploading PDF - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Error uploading PDF (/thread-26097.html)

Error uploading PDF - El Forum - 01-06-2010

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..

Error uploading PDF - El Forum - 01-06-2010

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')

Error uploading PDF - El Forum - 01-06-2010

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

Error uploading PDF - El Forum - 01-06-2010

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

Error uploading PDF - El Forum - 01-19-2010

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.

Error uploading PDF - El Forum - 09-07-2010

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.