PDF upload

See all posts Reply

PDF upload new!
by Ben, 17 years, 2 months ago
Hi,

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?Reply
Re: PDF upload new!
by colin, 17 years, 2 months ago
Can you copy and paste here the log ($handle->log)? Which browser do you use?

application/pdf should be working.

But you can try the following ones:
application/x-pdf
application/acrobat
applications/vnd.pdf
text/pdf
text/x-pdf

Tell me which one works for you.Reply
Re: PDF upload new!
by Rob, 16 years, 5 months ago
I'm having the same problem. Please help. Or maybe it my source, i've got the 'allowed' in the wrong place.Reply
Re: PDF upload new!
by colin, 16 years, 5 months ago
Can you copy and paste here the log ($handle->log)? Which browser do you use?Reply
Re: PDF upload new!
by Rob, 16 years, 5 months ago
Firefox

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
Reply
Re: PDF upload new!
by Rob, 16 years, 5 months ago
Also these are two lines of code i'm using
$handle = new Upload($file);
$handle->allowed = array('application/x-pdf', 
    'application/acrobat', 'applications/vnd.pdf',
    'text/pdf', 'text/x-pdf'); 

Many thanksReply
Re: PDF upload new!
by colin, 16 years, 5 months ago
Well, it is rather weird, because PHP hasn't received any file. So the class can't do much.

Does it do the same with any PDF documents?Reply
Re: PDF upload new!
by Sirius, 10 years, 5 months ago
Hello

please have look at this thread on github:
https://github.com/joomlaworks/k2/issues/54Reply
Re: PDF upload new!
by colin, 10 years, 5 months ago
Thank you, I have answered there.Reply
Re: PDF upload new!
by Rob, 16 years, 5 months ago
Yeah, i've tried 3 or 4 different one with differing sizes. I've used httpliveheaders (firefox plugin) and the file is going. So i'm as confused.Reply
Re: PDF upload new!
by Chaman, 16 years ago
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