Increased size of downloaded file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mekman
Forum Newbie
Posts: 1
Joined: Wed Aug 29, 2007 3:12 pm

Increased size of downloaded file

Post by mekman »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I'm trying to implement a php function for downloading a file from my web-site.
It is an executable.
When the file has been downloaded it its a couple of 100 bytes bigger than
it originally is.
The php code looks like this:

Code: Select all

header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Type: application/exe');
header('Content-Type: application/octet-stream');
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="Volume.exe"');
header("Content-Transfer-Encoding: binary");
readfile('../dlf/Volume.exe');
I've tried several combinations of the code but ends up with
the same problem.
If a use my FTP software simply to upload and download the size
remain, as it should. It changes only when I try to download
with the php code above.

Anyone ?

Regards,
Mikael


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

So downloading the same file via FTP & this script result in a different filesize? Have you checked the same file before & after uploading? I've never heard of this happening.

...does the file still run fine?

Also, please use [syntax="php"][/syntax] around your PHP code so we can read it easily.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply