note 27532 added to function.fpassthru

From: Date: Tue, 10 Dec 2002 02:56:56 +0000
Subject: note 27532 added to function.fpassthru
Groups: php.notes 
Request: Send a blank email to php-notes+get-40637@lists.php.net to get a copy of this message
When using readfile() -or fopen() and fpassthru() - make sure that if you are dealing with large files that are located on your server, use absolute paths and not URL's! Otherwise, the file will essentially be downloaded twice - the script will access the file from your web server itself, and then output it to the client, doubling the bandwidth. I made this mistake in a download script I made that included files on other servers, when the file was on mine, I forgot to use absolute paths. So, even for good practice if your files you're accessing are small, use absolute paths whenever possible. Seems obvious, but don't forget about it. -- http://www.php.net/manual/en/function.fpassthru.php http://master.php.net/manage/user-notes.php?action=edit+27532 http://master.php.net/manage/user-notes.php?action=delete+27532 http://master.php.net/manage/user-notes.php?action=reject+27532

« previous php.notes (#40637) next »