Page 1 of 1

quick file upload question

Posted: Mon Aug 21, 2006 10:01 am
by the_lar
Hi,

I'm using a form to upload images that are used in a PDF. I'm allowing GIF's and JPEGS. I'm detecting the file type via: $_FILES['userfile']['type'] - GIF's are fine and work when I upload 72 dpi or 300 dpi, however jpegs are only detected when they are 72 dpi???? Weird! The server is a Win2K with PHP 4.3 and apache 2.

Any help would be fab

Many thanks
Kevin

Posted: Mon Aug 21, 2006 10:10 am
by feyd
I wouldn't suggest using the type field. It's supplied by the user-agent and is easily faked. getimagesize() may be of interest. The version of PHP you're using may have issues interrogating some badly written jpeg files however, so you may need to upgrade PHP or GD depending on your compatibility and flexibility.