Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<CFCONTENT> donwload question 1

Status
Not open for further replies.

FurqanAhmed

Programmer
Joined
Oct 1, 2001
Messages
87
Location
PK
I programmed a cfm page to allow users to download some text files. The code in this cfm page is

---------------------------------------------------
<cfif IsDefined('Url.Rep') >
<cfset fileName = "C:\Inetpub\ >


<cfheader name="Content-disposition" value="attachment;filename=#fileName#">
<cfcontent type="text/plain" file="#fileName#">
</cfif>

-----------------------------------------------------

it works fine but the download dialog box displays page name in file name filed. Can anyone tell me how to set the name in the "file name" filed to the name of the file that the user is downloading?

Thanks
 
I use soemthing like you, and it works for me?

<cfheader name="Content-disposition" value="attachment;filename=#file_name#">
<cfcontent file="#file_name#" type="application/zip">

Kevin
 
Thanks for the hint Falconseye. The file name <cfheader> should be the file name and not the complete path. I just changed the <cfheader> to

<cfheader name="Content-disposition" value="attachment;filename=#Url.Rep#">


Thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top