Bashiliu.Class.php file
10*1024*1024) {echo ""; return;} Returns the header of the file ("Content-type:application/octet-stream");//Returns the header ("Accept-ranges:bytes") by byte size;//Returns the file size header ( "Accept-length: $file _size");//Here the client's popup dialog box, corresponding to the filename header ("content-disposition:attachment; Filename= ". $file _name);//Send the data back to the client $buffer=1024;//in order to download the security, we'd better make a file byte read counter $file_count=0;//This sentence is used to determine whether the file ends while (! Feof ($FP) && ($file _size-$file _count>0)) {$file _data=fread ($fp, $buffer);//Statistics read the number of bytes $file_count+=$ buffer;//send some data back to the browser; Echo $file _data;} Close file fclose ($fp);}? >
Comparison of source files and downloaded txt files
Reply to discussion (solution)
I've found a reason.
http://bbs.csdn.net/topics/390485077
It's not the reason.
Verify that the program file does not have a BOM header, there are no extra blank lines
$FP =fopen ($file _path, "R b"); To open in binary mode
Thank you moderator, and sure enough is the reason for the empty line