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

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

[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')
#3

[eluser]mattpointblank[/eluser]
Also, if you're specifying an array in your file uploading library config for allowed types, put PDF at the start.
#4

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

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

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




Theme © iAndrew 2016 - Forum software by © MyBB