I have come up with a solution but it is not working 100%. It seems like the
Content-Range header is not working. I return the correct Content-Length, but
it always starts at the beginning of the file. See code below...
<!--- If range is specified, then change some header info --->
<cfif StructKeyExists(GetHttpRequestData().headers, "Range")>
<!--- Range value --->
<cfset variables.range = ListLast(GetHttpRequestData().headers["Range"],"=")
/>
<!--- Calculate Range length --->
<cfset variables.max = ListLast(variables.range,"-")/>
<cfset variables.min = ListFirst(variables.range,"-")/>
<cfset variables.rangeLength = variables.max - variables.min + 1/>
<cfheader statuscode="206" statustext="Partial Content">
<cfheader name="Accept-Ranges" value="bytes">
<cfheader name="Content-Range" value="bytes
#variables.range#/#getFileSize.size#">
<cfheader name="Content-Length" value="#variables.rangeLength#">
<cfelse>
<cfheader name="Content-Length" value="#getFileSize.size#">
</cfif>
<!--- Open the file. --->
<cfheader name="Last-Modified" value="#variables.dateStr#">
<cfheader name="Content-disposition"
value="attachment;filename=#origFileName#">
<cfcontent type="application/octet-stream" file="#decryptedDoc#">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349424
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm