note 13098 deleted from function.ftp-get by jimw
| From: | jimw@php.net | Date: | Fri, 07 Dec 2001 02:00:02 +0000 |
| Subject: | note 13098 deleted from function.ftp-get by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-21795@lists.php.net to get a copy of this message | ||
If you want download the file to the client, use the function FTP_fgets
Look at this:
header("Content-disposition: filename=$file");
header("Content-type: application/octetstream");
header("Pragma: no-cache");
header("Expires: 0");
$fp = @fopen("$file", "w");
ftp_fget($ftp,$fp,"$file",FTP_BINARY) OR DIE("Erreur: Le fichier $file n'a pas
pu être mis en cache sur notre serveur.\r\nNous ne pouvons donc vous transférer le
fichier.\r\nVeuillez nous en excuser.");
@fclose($fp);
$fp = @fopen("$file","r");
while(!feof($fp))
{
$lignes .= fgets($fp,4096);
}
echo $lignes;
@fclose($fp);
unlink("$file");
The file will be download by the server, sent to the client and delete from the server.