Thread: Download portal
View Single Post
Old 07-29-2004, 10:22 PM   #5 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,736
redhead is on a distinguished road
A wild guess:
PHP Code:
//header("Content-Transfer-Encoding: binary"); 
maybe it should have been
PHP Code:
header("Content-Transfer-Encoding: binary"); 
From php.net:
Quote:
The default translation mode depends on the SAPI and version of PHP that you are using, so you are encouraged to always specify the appropriate flag for portability reasons. You should use the 't' mode if you are working with plain-text files and you use \n to delimit your line endings in your script, but expect your files to be readable with applications such as notepad. You should use the 'b' in all other cases.

If you do not specify the 'b' flag when working with binary files, you may experience strange problems with your data, including broken image files and strange problems with \r\n characters.

For portability, it is strongly recommended that you always use the 'b' flag when opening files with fopen().
So the opening of the file should be:
PHP Code:
$fh fopen("$file""rb"); 
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote