House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

ColdFusion Header to Serve a File

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Robert Harrison
06/14/2012 11:21 AM

I have the following code to serve a file for download:   <cfheader name="Content-Disposition" value="attachment; filename=#attach_file#">   <cfheader name="Content-Length" value="#file_size#">   <cfcontent type="#mime_type#" file="#getfile#"> All the variables are correct.        #attach_file# = the name of the file   #file_size# = the size of the file in bytes   #mime_type# = the correct mime type   #get_file# = the full physical path to the file and the file name No matter what I do it does not seem to know where the file is (get_file) is the full drive path and file name. It always tries to download from the web root. What am I missing here? Thanks, Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct   125 Kennedy Drive,  Suite 100   I  Hauppauge, NY 11788 T 631.231.6600 X 119   F 631.434.7022   http://www.austin-williams.com Blog:      http://www.austin-williams.com/blog Twitter:  http://www.twitter.com/austin_wi

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Chad Gray
06/14/2012 11:43 AM

Is your variable a typo?  #Get_file# vs. #GetFile#  in the cfcontent tag?  You typed it up two different ways in the post. ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Robert Harrison
06/14/2012 11:54 AM

Thanks. Issue resolved. The problem was a corrupt test file. Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct   125 Kennedy Drive,  Suite 100   I  Hauppauge, NY 11788 T 631.231.6600 X 119   F 631.434.7022   http://www.austin-williams.com Blog:      http://www.austin-williams.com/blog Twitter:  http://www.twitter.com/austin_williams Is your variable a typo?  #Get_file# vs. #GetFile#  in the cfcontent tag?  You typed it up two different ways in the post. ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 26, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference