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=subscribe&forumid=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