Last active
August 29, 2015 14:14
-
-
Save cflove/ac1cae5f4385e6d396b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfheader name="content-disposition" value="attachment; filename=test.txt"/> | |
<cfheader name="X-Sendfile" value="D:\iis\hello.txt"/> | |
<cfcontent type="text/plain"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Add File size to the header, IIS returns "Overflow or underflow in the arithmetic operation." For large file sizes. | |
Also IIS try to allocate memory ---> | |
<cfset filePath = "D:\iis\246.zip"> | |
<cfheader name="content-disposition" value="attachment; filename=246.zip"/> | |
<cfset Response = GetPageContext().GetResponse() /> | |
<cfset Response.setContentLength( createObject("java","java.io.File").init( filePath ).length() )> | |
<cfset Response.setHeader('X-Sendfile', filePath )> | |
<cfset Response.setContentType('application/octet-stream')> | |
<cfset Response.GetOutputStream().Flush() /> | |
<cfset Response.Reset() /> | |
<cfset Response.Finish() /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfheader name="content-disposition" value="attachment; filename=test.txt"/> | |
<cfset Response = GetPageContext().GetResponse() /> | |
<cfset Response.setHeader('X-Sendfile','D:\iis\hello.txt')> | |
<cfset Response.setContentType('plain/text')> | |
<cfset Response.GetOutputStream().Flush() /> | |
<cfset Response.Reset() /> | |
<cfset Response.Finish() /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment