uploading a pdf

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm trying to upload a pdf file using the $_FILES built in array

It gets stalled at this point and displays the echo

      echo "<b>File is not a picture. Please try another

This is the content of the $_FILES array
Array ( [name] => 000.pdf [type] => application/pdf [tmp_name] =>  
C:\PHP\uploadtemp\php2D.tmp [error] => 0 [size] => 26596 )

is it the 'type' thats wrong or the "image", I'm assuming I'm missing  
something in the mime type.

If I try to load a gif file using the same script, it works fine.

Thanks in anticipation


Re: uploading a pdf

Quoted text here. Click to load it

Either "image" doesn't match "application/pdf" or the Gods of Php just hate  
you. I'm guessing the former.

"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirvi
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)  

Re: uploading a pdf

Ofcourse it won't work. The scipt says in pseudo code, "if file type is
not image type (image/png, image/jpeg, image/gif, etc.) then echo file
is not a picture". Well, when you submit a pdf the file type is
application/pdf just like it says in the $_FILES array. If you want it
to work with pdf files then you'll need to remove this checking code.

Re: uploading a pdf

Quoted text here. Click to load it

Or, more logically, adapt the code to check for PDF files and not images :)  

Site Timeline