CodeIgniter Forums
Error uploading PDF - 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: Error uploading PDF (/thread-26097.html)



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

[eluser]dimazarno[/eluser]
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
Code:
echo $_FILES['userfile']['type']
, it return : image/ipeg

Hope you guys help me..


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

[eluser]umefarooq[/eluser]
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

Code:
application/config/mimes.php

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

[eluser]mattpointblank[/eluser]
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

[eluser]dimazarno[/eluser]
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

[eluser]bhensonweb[/eluser]
I had a similar problem while trying to upload a PDF. My 'allowed_filetypes' setting was:

Code:
$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:

Code:
$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

[eluser]shahmy[/eluser]
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
Code:
'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.