Hi,
I'm trying to use <cfheader name="Content-Length" value="57000"> as part of a
file download but all I get is an empty file. If I remove the tag it downloads
the file correctly. Any suggestions what might be going wrong?
My code
<cfheader name="Content-Length" value="57000">
<cfheader name="Content-Disposition" value="attachment;
filename=downloadfile.exe">
<cfcontent file="C:\downloadfile.exe" deletefile="NO"
type="APPLICATION/OCTET-STREAM">
I'm running CF8, Apache 2.xx on a Window 2003 server.
GArlington - 08 May 2008 09:40 GMT
> Hi,
> I'm trying to use <cfheader name="Content-Length" value="57000"> as part of a
[quoted text clipped - 9 lines]
>
> I'm running CF8, Apache 2.xx on a Window 2003 server.
How did you come up with the figure 57000?
Do you realise that the figure that you specify overwrites the
calculated figure and then the browser will be expecting EXACTLY 57000
bytes to be downloaded?
You should read about TCP/IP and HTTP protocol if you did NOT know
that...
Fundyfog - 08 May 2008 13:14 GMT
Your value for content length looks a little, shall I say, too rounded. You should use GetFileInfo([i]path\file.ext[/i]).size to find the actual file size in bytes.