class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
I don't know if it helps, but I had to add 'application/octet' to get pdfs to work.
Strangely though, pdfs were uploaded fine when I first wrote the code (without any mime type checking), but now (several months on) it was broken. I may have switched to using a new version of class.upload or it may have been something has changed on the server....Reply
I used the simple upload to try to up some pdf files :
Error: Incorrect type of file
I used
$handle->allowed = array('application/pdf','application/msword');That doesn't fix it !Can you help me?
application/pdf should be working.
But you can try the following ones:
Tell me which one works for you.
source is an uploaded file - source variables file_src_name : file_src_name_body : file_src_name_ext : file_src_pathname : file_src_mime : file_src_size : (max= 67108864) file_src_error : 4$handle = new Upload($file); $handle->allowed = array('application/x-pdf', 'application/acrobat', 'applications/vnd.pdf', 'text/pdf', 'text/x-pdf');Many thanks
Does it do the same with any PDF documents?
please have look at this thread on github:
https://github.com/joomlaworks/k2/issues/54
Strangely though, pdfs were uploaded fine when I first wrote the code (without any mime type checking), but now (several months on) it was broken. I may have switched to using a new version of class.upload or it may have been something has changed on the server....