note 24649 added to function.fpassthru

From: Date: Sat, 24 Aug 2002 13:14:12 +0000
Subject: note 24649 added to function.fpassthru
Groups: php.notes 
Request: Send a blank email to php-notes+get-35458@lists.php.net to get a copy of this message
A few notes on using fpassthru() to php-driven download links that pop up a "Save As.." dialog: 1. I found that the download progress dialog was remaining up for several seconds after the transfer was completed, before telling the user it was complete. This was fixed by adding the following header: header ("Connection: close"); This will cause the connection to be closed as soon as the transfer is complete, rather than waiting for a timeout. 2. If you have multiple periods in the filename, you might wind up with a filename with numbers in brackets (such as myfile-[1][0]-windows.zip when you put myfile-1.0-windows.zip in the headers) with MSIE. According to Microsoft's KB, his is a "known" bug having to due with MSIE's cache and there's no workaround that I was able to find. 3. Through no amount of futzing of headers was I able to get the filename to be set properly when the actual transfer was initiated via a refresh (META or via headers). I don't know if this is also an MSIE only issue or not. If 'download.php?dl=now' (for example) had a refresh back to 'download.php', such that it was intended to show some information (e.g. install instructions) as well as launch the download, then the MSIE insisted that the downloaded file was supposed to be named 'download.php?dl=now' or 'download.php', ignoring the filename in the headers. -- http://www.php.net/manual/en/function.fpassthru.php http://master.php.net/manage/user-notes.php?action=edit+24649 http://master.php.net/manage/user-notes.php?action=delete+24649 http://master.php.net/manage/user-notes.php?action=reject+24649

« previous php.notes (#35458) next »