I'm trying to upload a JPEG image into a database using PHP and I was successful with the upload.  However today I wanted to add a check to make sure the user can only upload JPEG files and not any other files so I use preg_match() to check for the strings ".jpg" or ".jpeg" in the filename and after I've inserted this check into my code all my attempts to upload files started to fail.  I was mulling over the code and I decided to print out the name of the uploaded file and to my suprise the name was mangled.  Instead of it being "picture.jpg" it was "/tmp/progtemp/php/uploads/phpeZQiXd".  Can anyone shed some light as to how I could check to make sure that only JPEG images get uploaded ?  Thanks in advance...

-Pete

-- 
perl -e 'print pack("H*", "70766572746573406E79632E72722E636F6D0A")'

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to