ID:               43306
 Updated by:       [EMAIL PROTECTED]
 Reported By:      d dot tas40 at chello dot nl
-Status:           Open
+Status:           Feedback
 Bug Type:         Scripting Engine problem
 Operating System: Windows XP
 PHP Version:      5.2.5
 New Comment:

Are you sure there aren't any errors happening there? Check the file
you downloaded using e.g. notepad..


Previous Comments:
------------------------------------------------------------------------

[2007-11-15 18:17:43] d dot tas40 at chello dot nl

Description:
------------
File Download Problem.

Reproduce code:
---------------
// set headers
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: $mtype");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $filesize);

// download
// @readfile($file_path);
$file = @fopen($file_path,"rb");
if ($file) {
  while(!feof($file)) {
    print(fread($file, 1024*8));
    flush();
    if (connection_status()!=0) {
      @fclose($file);
      die();
    }
  }
  @fclose($file);
}

Expected result:
----------------
It works fine with PHP v5.2.3/4 but after I updated my PHP version to
5.2.5 it doesn't work..

I click on the download link, but the downloaded file always corrupt..


xxx.rar: The archive is either in unknown format or damaged!
xxx.rar: The archive is either in unknown format or damaged!




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43306&edit=1

Reply via email to