On Sun, 19 May 2002, andy wrote:
> I do have trouble with finding out if a file is a jpeg or not.  This is the
> command I am using:
> 
>  $_FILES[picture_location][type]
> 
> works fine exept in one case: With Photoshop 6.0 I do open the jpeg (which
> workes fine) an save as jpeg as another file name. Then upload the new file.
> This returns a type called:
> 
> application/octet-stream
> 
> So what is this type anyway. I do know jpeg and jpg and pjpeg but
> octed-stream?!

application/octet-stream just means a generic binary file.

I don't think that $_FILES[]['type'] is really all that useful for getting
reliable information about a file, since it just trusts the browser/user,
which could be uninformed, misinformed, or deliberately dishonest. Either
pass the temp file to the unix 'file' command or peek inside it on your
own (check the 'magic' file that comes with the unix 'file' command for
details on what to look for).

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to