downloading a big .exe fails

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi -

I have a restricted download I want to set up.  It's about 19 megs.
It downloads fine, but it mysteriously adds 2 extra bytes to the
file.  If I grab the file directly via ftp, it's fine, so I know the
file is good.  I don't want to put the download in a public place
because I need to track who is downloading when.  Here's the code:

function StartDownload()

$fp = fopen($file, "rb");

header('Content-type: Application/Octet-Stream');
header('Content-Disposition: attachment; filename="demo-
header('Content-Encoding: none');

//readfile($file);  //have tried this too,

Any ideas why this doesn't work and how to fix it?

I read somewhere else that http compression may be the culprit, but I
don't know if it's possible to turn off compression in the code

Thanks for any help,

Re: downloading a big .exe fails

Greetings, dino d..
In reply to Your message dated Thursday, July 10, 2008, 23:00:42,

Quoted text here. Click to load it

I'm sure it is not your code, but the file where you have it placed.
Check it for any additional line breaks. Or better, remove anything before
"<?php" or after "?>", even linefeeds.
And I think that "header('Content-Encoding: none');" is worthless.


Site Timeline