Re: how to determine the actual file format of an image file?

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 44603
interpreted = N
texte = on 10/30/02 12:40 PM, Frank Nordberg at frnordbe@online.no so noted...> Unfortunately the MIME type won't be much more reliable than the file > extension in this case. There are still one or two Windows computers out > there on the web, and apparently their browsers just set the MIME type > according to the file extension anyway.I'm a little spoiled because the site that's receiving the uploads gets the majority of traffic from Macs, and the browser is setting the MIME type from the internal type/creator codes (and many of the uploaded files don't have extensions in the filename itself).If WebDNA could process null characters, you could include the file in question and check the file headers there.One possibility to get around that limitation would be to encrypt the file as base64 and check for the appropriate encoded text.[showif [getchars start=1&end=4][encrypt method=base64&file=mysteryFile.zzz][/encrypt][/getchars]=R0lG] We have a GIF! [/showif][showif [getchars start=1&end=17][encrypt method=base64&file=mysteryFile.zzz][/encrypt][/getchars]^SkZJRg] We have a JPEG! [/showif]R0lG and SkZJRg being the base64 encodings of GIF and JFIF respectively.Not extensively tested, but perhaps a place to start. Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: how to determine the actual file format of an image file? (Rob Marquardt 2002)
  2. Re: how to determine the actual file format of an image file?- done (dale's stuff 2002)
  3. Re: how to determine the actual file format of an image file? (dale's stuff 2002)
  4. Re: how to determine the actual file format of an image file? (Jason Tyler 2002)
  5. Re: how to determine the actual file format of an image file? (dale's stuff 2002)
  6. Re: how to determine the actual file format of an image file? (Rob Marquardt 2002)
  7. Re: how to determine the actual file format of an image file? (Glenn Busbin 2002)
  8. Re: how to determine the actual file format of an image file? (Frank Nordberg 2002)
  9. Re: how to determine the actual file format of an image file? (Brian Boegershausen 2002)
  10. Re: how to determine the actual file format of an image file? (Alain Russell 2002)
  11. Re: how to determine the actual file format of an image file? (dale's stuff 2002)
  12. Re: how to determine the actual file format of an image file? (Rob Marquardt 2002)
  13. how to determine the actual file format of an image file? (dale's stuff 2002)
on 10/30/02 12:40 PM, Frank Nordberg at frnordbe@online.no so noted...> Unfortunately the MIME type won't be much more reliable than the file > extension in this case. There are still one or two Windows computers out > there on the web, and apparently their browsers just set the MIME type > according to the file extension anyway.I'm a little spoiled because the site that's receiving the uploads gets the majority of traffic from Macs, and the browser is setting the MIME type from the internal type/creator codes (and many of the uploaded files don't have extensions in the filename itself).If WebDNA could process null characters, you could include the file in question and check the file headers there.One possibility to get around that limitation would be to encrypt the file as base64 and check for the appropriate encoded text.[showif [getchars start=1&end=4][encrypt method=base64&file=mysteryFile.zzz][/encrypt][/getchars]=R0lG] We have a GIF! [/showif][showif [getchars start=1&end=17][encrypt method=base64&file=mysteryFile.zzz][/encrypt][/getchars]^SkZJRg] We have a JPEG! [/showif]R0lG and SkZJRg being the base64 encodings of GIF and JFIF respectively.Not extensively tested, but perhaps a place to start. Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Rob Marquardt

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Using Cookie for client specific info? (1997) How to show via drop down menu? (2000) Transfer of data from Invoice to thank you templates (1998) Calculating Age from DB fields (2003) Another question (1997) OT: [WAY IN RIGHT FIELD SOMEWHERE] Spam Filters (2005) Ampersand Character (&) (1997) Sort Order on a page search (1997) can WC render sites out? (1997) Upgrade to 3.07 problems (2000) WC 2.0 frames feature (1997) RE: redirect with more than 256 characters (1999) NT vs Mac (1997) A little syntax help (1997) cookies and [returnraw] (1997) Caching problem... (2000) Re[2]: Enhancement Request for WebCatalog-NT (1996) Encrypted Templates Serving as Text (2000) NT considerations (1997) Problems appending to database (1997)