RE: Forcing dowload of text file, unformatted
How do I force the download of a TEXT file to the client browser? I tried this, but it gives me a strange filename. What I want for a filename is: Assemblymap_1006.txt Instead I get Kit_download_assemblymap.cfm For the filename. So what am I doing wrong: CFHEADER NAME=Cache-Control VALUE=0 CFHEADER name=Content-type value=application/octet-stream CFHEADER name=Content-Disposition value=attachment; filename=assemblymap_#url.id#.txt cfcontent file=assemblymap_#url.id#.txt type=application/octet-stream ALSO, I need to download UNFORMATTED text as it appears in the original file. The downloaded file seems to have spaces and linebreaks removed. I can do it on the screen with a pre tag. You might find these examples useful: http://www.figleaf.com/demo/mimetest/ Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192653 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Forcing dowload of text file, unformatted
I wrote this tag up to do file pushes of all kinds. The example below will force open a show/save dialog. If you want to display in the browser window itself, To send a txt file straight to the browser for display (maintaining your formatting) change variables.DisplayType to inline. !--- the tag call --- cfset variables.FilePath=z:\myfiles\ftp\ cfset variables.FileName=mysecretfile.txt cfset variables.MIMEType=text/plain cfset variables.DisplayType=attachment cf_pushfile FilePath=#variables.FilePath# FileName=#variables.FileName# MIMEType=#variables.MIMEType# DisplayType=#variables.DisplayType# !--- cf_pushfile --- cfset variables.FileToPush=attributes.FilePathattributes.FileName cfheader name=content-disposition value=#attributes.DisplayType#; filename=#attributes.FileName# cfcontent type=#attributes.MIMEType# file=#variables.FileToPush# I adapted the above from the tutorial here: http://mysecretbase.com/How_To_Display_Protected_Files.cfm HtH, -- --mattRobertson-- Janitor, MSB Web Systems mysecretbase.com ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192245 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Forcing dowload of text file, unformatted
This is great, Thank you. Also, it turns out that my formatting problem results from the original text file begin generated on a UNIX system, so there is some sort of problem with end of line characters when displayed on non-unix systems ... -Original Message- From: Matt Robertson [mailto:[EMAIL PROTECTED] Sent: Sunday, January 30, 2005 9:06 AM To: CF-Talk Subject: Re: Forcing dowload of text file, unformatted I wrote this tag up to do file pushes of all kinds. The example below will force open a show/save dialog. If you want to display in the browser window itself, To send a txt file straight to the browser for display (maintaining your formatting) change variables.DisplayType to inline. !--- the tag call --- cfset variables.FilePath=z:\myfiles\ftp\ cfset variables.FileName=mysecretfile.txt cfset variables.MIMEType=text/plain cfset variables.DisplayType=attachment cf_pushfile FilePath=#variables.FilePath# FileName=#variables.FileName# MIMEType=#variables.MIMEType# DisplayType=#variables.DisplayType# !--- cf_pushfile --- cfset variables.FileToPush=attributes.FilePathattributes.FileName cfheader name=content-disposition value=#attributes.DisplayType#; filename=#attributes.FileName# cfcontent type=#attributes.MIMEType# file=#variables.FileToPush# I adapted the above from the tutorial here: http://mysecretbase.com/How_To_Display_Protected_Files.cfm HtH, -- --mattRobertson-- Janitor, MSB Web Systems mysecretbase.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192248 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54