note 53689 added to function.fpassthru

From: Date: Thu, 09 Jun 2005 11:10:05 +0000
Subject: note 53689 added to function.fpassthru
Groups: php.notes 
Request: Send a blank email to php-notes+get-90167@lists.php.net to get a copy of this message
I am trying to write a php code to download files from server. Here is the code : header('Content-Description: File Transfer'); header('Content-Type: application/force-download'); header('Content-Length: $size'); header("Content-Type: application/download"); header("Content-Type: $type"); header('Content-Disposition: attachment; filename="' . basename($filename) . '"'); readfile($file); The file gets downloaded but the downloaded file size is ZERO ie the file downloaded is empty. ---- Manual Page -- http://www.php.net/manual/en/function.fpassthru.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+53689 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53689&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53689&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53689&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53689&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53689&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+53689&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#90167) next »