I thought this is a secure way to find out if the file is a jpeg or not. So you are suggesting to passit to the unix command file? How does that work. Maybe you can make a small example or give a small hint on what to look for on google. Sound interesting!
I tryed to to perform a createfromjpeg command to that file and it did not work. So the magic is to save it in photoshop for web and then as jpeg and not with save as (jpeg). But this gives me a headache, because how do user know the difference? The file extension is jpeg and all programms can display it. Maybe there is a way in php as well to do a kind of createfromjpeg commmand?! Thanx, Andy "Miguel Cruz" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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