note 42530 added to function.readfile

From: Date: Thu, 20 May 2004 07:48:15 +0000
Subject: note 42530 added to function.readfile
Groups: php.notes 
Request: Send a blank email to php-notes+get-69863@lists.php.net to get a copy of this message
When making a file-download script, you might want to let the user know how much time left there is. That is accomplished with the "Content-Length" header. $size= filesize("$filename"); header("Content-Length: ".$size.); In some rare ocations the file will take long times to download using this statement.So I´ve added the "bytes" part, and it works perfectly now (the problem is that i dont know if this will be for or against the protocol specs.. Like this: header("Content-Length: ".$size. "bytes"); ---- Manual Page -- http://www.php.net/manual/en/function.readfile.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42530 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42530&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42530&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69863) next »