RE: force a download - .txt file
This method forces the download, but names the file index.cfm instead of the actual filename that you are downloading. Anyone know how to name it properly? Dan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 5:18 PM To: CF-Talk Subject: Re: force a download - .txt file You could just do: CFHEADER NAME=content-disposition VALUE=attachment;filename=#YourFile# - Original Message - From: Bryan Stevenson [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 4:57 PM Subject: Re: force a download - .txt file CFHEADER NAME=content-disposition VALUE=inline; filename=#YourFile# cfcontent type=unknown file=#AbsoluteFilePath# deleteFile=Yes ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: force a download - .txt file
Trying to force a download using cfcontent and input from last week thread. Below is full download page's code. 1. Works properly, forcing download with a txt, a pdf, .xls, .doc 2. If item is .jpg, get in IE6 An error occurred while attempting to open the file. Windows NT error number 5 occurred. In Netscape6, get opening/closing html and body tags 3. In #2, doesn't go to the cfcatch routine. Appreciate any help why works for some, but not jpg. Download page's code: CFSet thePath = request.BasicPath Documents\ CFSet theDoc = Url.theDoc CFSet full2doc = thePath theDoc !--- ensure that requested file exists --- CFIF NOT FileExists(full2doc) cflocation url=noAvailable.cfm?type=notDwnLd CFElse CFHeader name=content-disposition value=attachment;filename=#theDoc# CFTry CFContent type=unknown file=#full2doc# CFCatch type=Any can't seem to get this cfabort /CFCATCH /CFTRY /CFIF E. Keith Dodd Wings of Eagles Services www.wingserv.com - Original Message - From: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 5:17 PM Subject: Re: force a download - .txt file You could just do: CFHEADER NAME=content-disposition VALUE=attachment;filename=#YourFile# - Original Message - From: Bryan Stevenson [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 4:57 PM Subject: Re: force a download - .txt file CFHEADER NAME=content-disposition VALUE=inline; filename=#YourFile# cfcontent type=unknown file=#AbsoluteFilePath# deleteFile=Yes - [This E-mail scanned for viruses by declude AntiVirus Software] ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
force a download - .txt file
Hi everyone. I am trying to force a save as box in IE when a user clicks on a link that creates a .txt file. What keeps happening is that the browser will open the .txt file and display it - when what I really want is for the user to be prompted with a save as box. Has anyone figured out a way to do this? Thanks very much. Keith ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: force a download - .txt file
CFHEADER NAME=content-disposition VALUE=inline; filename=#YourFile# cfcontent type=unknown file=#AbsoluteFilePath# deleteFile=Yes HTH Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. t. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder Director www.cfug-vancouverisland.com - Original Message - From: Wurst, Keith D. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 1:52 PM Subject: force a download - .txt file Hi everyone. I am trying to force a save as box in IE when a user clicks on a link that creates a .txt file. What keeps happening is that the browser will open the .txt file and display it - when what I really want is for the user to be prompted with a save as box. Has anyone figured out a way to do this? Thanks very much. Keith ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: force a download - .txt file
You could serve the file up with CFCONTENT and use a Content-disposition header to mark the content as an attachment (giving you the Save As box). This would require the file to be called via a cfm file though, instead of a straight link to the text file. Perhaps there is a better way.. HTH -R -Original Message- From: Wurst, Keith D. [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 4:52 PM To: CF-Talk Subject: force a download - .txt file Hi everyone. I am trying to force a save as box in IE when a user clicks on a link that creates a .txt file. What keeps happening is that the browser will open the .txt file and display it - when what I really want is for the user to be prompted with a save as box. Has anyone figured out a way to do this? Thanks very much. Keith ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: force a download - .txt file
You could just do: CFHEADER NAME=content-disposition VALUE=attachment;filename=#YourFile# - Original Message - From: Bryan Stevenson [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 4:57 PM Subject: Re: force a download - .txt file CFHEADER NAME=content-disposition VALUE=inline; filename=#YourFile# cfcontent type=unknown file=#AbsoluteFilePath# deleteFile=Yes ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4