This is great, Thank you.

Also, it turns out that my formatting problem results from the original text
file begin generated on a UNIX system, so there is some sort of problem with
end of line characters when displayed on non-unix systems ... 

-----Original Message-----
From: Matt Robertson [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 30, 2005 9:06 AM
To: CF-Talk
Subject: Re: Forcing dowload of text file, unformatted

I wrote this tag up to do file pushes of all kinds.  The example below will
force open a show/save dialog.  If you want to display in the browser window
itself, To send a txt file straight to the browser for display (maintaining
your formatting) change variables.DisplayType to "inline".

<!--- the tag call --->
<cfset variables.FilePath="z:\myfiles\ftp\">
<cfset variables.FileName="mysecretfile.txt
<cfset variables.MIMEType="text/plain">
<cfset variables.DisplayType="attachment">
<cf_pushfile 
      FilePath=#variables.FilePath# 
      FileName=#variables.FileName#
      MIMEType=#variables.MIMEType#
      DisplayType=#variables.DisplayType#> 


<!--- cf_pushfile --->
<cfset variables.FileToPush=attributes.FilePath&attributes.FileName>
<cfheader
   name="content-disposition" 
   value="#attributes.DisplayType#; filename=#attributes.FileName#">
<cfcontent 
   type="#attributes.MIMEType#" 
   file=#variables.FileToPush#>

I adapted the above from the tutorial here:
http://mysecretbase.com/How_To_Display_Protected_Files.cfm

HtH,

-- 
--mattRobertson--
Janitor, MSB Web Systems
mysecretbase.com



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192248
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to