Re: [PHP] Re: filtering filename.ext on file-upload.

2004-01-15 Thread Louie Miranda
if JPEG is = image/pjpeg how about PDF files? thanks, Louie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: filtering filename.ext on file-upload.

2004-01-15 Thread Louie Miranda
code> if ($_FILES['imagefile']['type'] != "image/pjpeg") >The 'type' in $_FILES is provided by the browser. IIRC only IE uses >"image/pjpeg" whilst other browsers use "image/jpeg". But regardless of what >the browser sets, it is more reliable to get the image type from >getimagesize(). If im go

[PHP] Re: filtering filename.ext on file-upload.

2004-01-15 Thread Ben Ramsey
How can you filter the extension for files being uploaded > on a system via form. Use pathinfo() ... check it out at http://www.php.net/manual/en/function.pathinfo.php -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: filtering filename.ext on file-upload.

2004-01-15 Thread Matt Hedges
try this, it works for me: if ($_FILES['imagefile']['type'] != "image/pjpeg") { print("File must be a .jpg. File will not be accepted; please choose a .jpg picture or convert the picture to .jpg format."); unlink($filename); // This will remove the temporary file so we don't have to deal wit