RE: CFContent, MIME types, filenames, browsers
Hi all, Re: CFCONTENT, MIME types, filenames, browsers You have to deal with BOTH browsers. IE tends to ignore MIME types and look at the file extension, so you have to use a trick. Basically, you just tack a fake filename onto the end of your URL, like so: http://servername/cfdocs/index.cfm/xyz.doc?fuseaction=showWordDoc (this is a FuseBox exaample, but it works for non-FuseBox as well) As you see, any URL parameters get added AFTER the fake filename. Now index.cfm (fuseaction=showWordDoc) gets invokded on the server, and has to build the doc on the fly. You then use CFCONTENT to specify the MIME type, application/msword (for Netscape's benefit). The /xyz.doc tacked onto the URL fools both browsers about the filename, and IE looks at the .doc extension to figure out how to display the file. That's the basic technique. Let me know if anyone needs more detail. Best of luck, Lee (Bjork) Borkman http://bjork.net ColdFusion Tags by Bjork -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Using CFCONTENT, MIME types, etc...
I want my users to be directed to a page that automatically throws them a document. The document is a .PQA file, which is a Palm Query Application for the Palm Pilot. My understanding was that I needed to specify the MIME type in IIS and then use CFCONTENT to serve the file. Since there is no MIME type set up (or at least not that I could figure out) I picked the one listed below. However, when I do that, it throws me the CFM page the code is on. Here is the code I wm using... cfcontent type="application/x-msdownload" file="D:\Inetpub\wwwroot\BOX\bWireless\Builder\output\#OutputName#" deletefile="No" If I just do a CFLOCATION directly to the file, it works fine. But I want to figure out why CFCONTENT isn't working and would rather use that. Anyone? Thanks, Steve -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Using CFCONTENT, MIME types, etc...
I use application/unknown as a mime type when I want to force a download box. If you have the actual mime type for PQA files, that can be used as well (but can have other problems). I want my users to be directed to a page that automatically throws them a document. The document is a .PQA file, which is a Palm Query Application for the Palm Pilot. My understanding was that I needed to specify the MIME type in IIS and then use CFCONTENT to serve the file. Since there is no MIME type set up (or at least not that I could figure out) I picked the one listed below. However, when I do that, it throws me the CFM page the code is on. Here is the code I wm using... cfcontent type="application/x-msdownload" file="D:\Inetpub\wwwroot\BOX\bWireless\Builder\output\#OutputName#" deletefile="No" If I just do a CFLOCATION directly to the file, it works fine. But I want to figure out why CFCONTENT isn't working and would rather use that. Anyone? Thanks, Steve -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: CFContent MIME Types
Hi Dave Try added this before your Cfcontent tag: to display in the browser: cfheader name="Content-Disposition" value="inline; filename="XYZ.txt" to download : cfheader name="Content-Disposition" value="attachment; filename="XYZ.txt" ~JustinMacCarthy - Original Message - From: "Dave Hannum" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Friday, July 28, 2000 12:50 PM Subject: CFContent MIME Types Is there a list of the different MIME types that should be used with CFContent? I'm returning a .txt file, but when it comes up on the user's machine, it comes up with the name of the script (script.cfm) instead of the file name (xyz.txt). I think it has something to do with the MIME type in the CFContent tag. Thanks, Dave = "What we need is a list of specific unknown problems we will encounter" David Hannum Web Analyst/Programmer Ohio University [EMAIL PROTECTED] (740) 597-2524 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: CFContent MIME Types
Is there a list of the different MIME types that should be used with CFContent? Right click and edit tag. I'm returning a .txt file, but when it comes up on the user's machine, it comes up with the name of the script (script.cfm) instead of the file name (xyz.txt). I think it has something to do with the MIME type in the CFContent tag. Try this... a href="template.cfm?whateveryouwant/firstfivereleases.html" It will fool most browsers. Cool, huh? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: CFContent MIME Types
OK, I didn't explain. I'm not trying to open the file in a browser You see, the info can be returned in the users choice of three ways, To the browser, to an Excel Spreadsheet or to an ASCII file (for MAC users or others who don't have Excel). Browser rolls the page to the info. Excel does not roll the page, but rather returns the prompt to run or save to disk. ASCII file does the same, except that instead of saying file xyz.txt, it displays the script name (whatever.cfm) - the problem is that the users machine does not know how to open a .cfm file. Hope this explains better g Dave - Original Message - From: "JustinMacCarthy" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 28, 2000 7:56 AM Subject: Re: CFContent MIME Types Hi Dave Try added this before your Cfcontent tag: to display in the browser: cfheader name="Content-Disposition" value="inline; filename="XYZ.txt" to download : cfheader name="Content-Disposition" value="attachment; filename="XYZ.txt" ~JustinMacCarthy - Original Message - From: "Dave Hannum" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Friday, July 28, 2000 12:50 PM Subject: CFContent MIME Types Is there a list of the different MIME types that should be used with CFContent? I'm returning a .txt file, but when it comes up on the user's machine, it comes up with the name of the script (script.cfm) instead of the file name (xyz.txt). I think it has something to do with the MIME type in the CFContent tag. Thanks, Dave = "What we need is a list of specific unknown problems we will encounter" David Hannum Web Analyst/Programmer Ohio University [EMAIL PROTECTED] (740) 597-2524 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: CFContent MIME Types
Hi Justin, This throws an error. It does not like the "FILENAME" attribute. It says it's unknown. Any suggestions? cfheader name="Content-Disposition" value="attachment; filename="XYZ.txt" Plus, isn't this a " short? You have a double quote after value=, but no matching end quote. Thanks, Dave -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: CFContent MIME Types
too many quotes. - Original Message - From: "Dave Hannum" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 28, 2000 8:21 AM Subject: Re: CFContent MIME Types Hi Justin, This throws an error. It does not like the "FILENAME" attribute. It says it's unknown. Any suggestions? cfheader name="Content-Disposition" value="attachment; filename="XYZ.txt" Plus, isn't this a " short? You have a double quote after value=, but no matching end quote. Thanks, Dave -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: CFContent MIME Types
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Is there a list of the different MIME types that should be used with CFContent? I'm returning a .txt file, but when it comes up on the user's machine, it comes up with the name of the script (script.cfm) instead of the file name (xyz.txt). I think it has something to do with the MIME type in the CFContent tag. Your MIME type for that should be 'text/plain'. The problem isn't the MIME type, but the way browsers handle downloaded filenames. To make this work under most versions of IE, add this line above the CFCONTENT tag: cfheader name="Content-Disposition" value="attachment; filename=""xyz.txt""" Netscrape ignored this header last time I checked. I don't know if they've fixed it yet. For Netscape, you have to play around with masking URL parameters, but that got broken w/ NT SP6, so I don't remember how to do it any longer. Best regards, Zac Bedell -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.3 for non-commercial use http://www.pgp.com iQA/AwUBOYF/dQraVoMWBwRBEQLUIgCgyN26kM4sVjIMaFSgDzbt9G05Ko8AniSz oQYQfgsXAQ3K5pj6E0wX5NV0 =Ouxp -END PGP SIGNATURE- -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: CFContent MIME Types
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 a href="template.cfm?whateveryouwant/firstfivereleases.html" Yup... That's how I used to do it until NT SP6 broke that. I dunno whether it works under 451 or under Win2k. Anyone else tried that under either 451 and/or Win2k? (Under NT SP6, you get 404 not found for firstfivereleases.html in that case.) Best regards, Zac Bedell -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.3 for non-commercial use http://www.pgp.com iQA/AwUBOYGAHAraVoMWBwRBEQL4rQCgr7kRuLqXHRAidGgu5Wc/600V3zgAn2ki Fs/7RpofgR9TWnDM6S5+KUCR =thq+ -END PGP SIGNATURE- -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: CFContent MIME Types
Works like a charm. However, TYPE="text/plain" in the CFCONTENT tag returns it to the browser. I replaced text/plain with application/unknown and it works fine. Thanks for the help! Dave - Original Message - From: "Zachary Bedell" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 28, 2000 8:41 AM Subject: RE: CFContent MIME Types -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Is there a list of the different MIME types that should be used with CFContent? I'm returning a .txt file, but when it comes up on the user's machine, it comes up with the name of the script (script.cfm) instead of the file name (xyz.txt). I think it has something to do with the MIME type in the CFContent tag. Your MIME type for that should be 'text/plain'. The problem isn't the MIME type, but the way browsers handle downloaded filenames. To make this work under most versions of IE, add this line above the CFCONTENT tag: cfheader name="Content-Disposition" value="attachment; filename=""xyz.txt""" Netscrape ignored this header last time I checked. I don't know if they've fixed it yet. For Netscape, you have to play around with masking URL parameters, but that got broken w/ NT SP6, so I don't remember how to do it any longer. Best regards, Zac Bedell -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.3 for non-commercial use http://www.pgp.com iQA/AwUBOYF/dQraVoMWBwRBEQLUIgCgyN26kM4sVjIMaFSgDzbt9G05Ko8AniSz oQYQfgsXAQ3K5pj6E0wX5NV0 =Ouxp -END PGP SIGNATURE- -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.