Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / May 2008



Tip: Looking for answers? Try searching our database.

CFHeader question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ashburton - 07 May 2008 18:57 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.