Skip to content

Instantly share code, notes, and snippets.

@youcoldfusion
Created April 5, 2013 10:28
Show Gist options
  • Save youcoldfusion/5318267 to your computer and use it in GitHub Desktop.
Save youcoldfusion/5318267 to your computer and use it in GitHub Desktop.
<cfdirectory>,<cfcontent>,<cfheader>
<!--- It will download the file what we click--->
<cfcontent type="text/html" >
<cfheader name="Content-Disposition" value="attachment;filename=#url.name#" >
<cffile action="read" file="PATHTOTHEFOLDER\#url.name#" variable="displayFileContent" >
<cfoutput>#displayFileContent#</cfoutput>
<!--- It will list all the files with anchors of the below mentioned folder--->
<cfdirectory directory="PATHTOTHEFOLDER" name="dirinfo">
<h2>List of files</h2>
<cfoutput query="dirinfo">
<a href="/contentDownload.cfm?name=#name#">#name#</a><br/>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment