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 themajority of traffic from Macs, and the browser is setting the MIME type fromthe internal type/creator codes (and many of the uploaded files don't haveextensions in the filename itself).If WebDNA could process null characters, you could include the file inquestion and check the file headers there.One possibility to get around that limitation would be to encrypt the fileas base64 and check for the appropriate encoded text.[showif [getchars start=1&end=4][encryptmethod=base64&file=mysteryFile.zzz][/encrypt][/getchars]=R0lG]We have a GIF![/showif][showif [getchars start=1&end=17][encryptmethod=base64&file=mysteryFile.zzz][/encrypt][/getchars]^SkZJRg]We have a JPEG![/showif]R0lG and SkZJRg being the base64 encodings of GIF and JFIFrespectively.Not extensively tested, but perhaps a place to start.Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.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:
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 themajority of traffic from Macs, and the browser is setting the MIME type fromthe internal type/creator codes (and many of the uploaded files don't haveextensions in the filename itself).If WebDNA could process null characters, you could include the file inquestion and check the file headers there.One possibility to get around that limitation would be to encrypt the fileas base64 and check for the appropriate encoded text.[showif [getchars start=1&end=4][encryptmethod=base64&file=mysteryFile.zzz][/encrypt][/getchars]=R0lG]We have a GIF![/showif][showif [getchars start=1&end=17][encryptmethod=base64&file=mysteryFile.zzz][/encrypt][/getchars]^SkZJRg]We have a JPEG![/showif]R0lG and SkZJRg being the base64 encodings of GIF and JFIFrespectively.Not extensively tested, but perhaps a place to start.Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.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)