note 6826 deleted from function.copy by jimw

From: Date: Fri, 07 Dec 2001 02:09:37 +0000
Subject: note 6826 deleted from function.copy by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-21801@lists.php.net to get a copy of this message
To serve a file to a client from the server you can do this: (This also enables dynamic file content just by altering what is echo'd out) <? $fp = fopen("file.x","r"); $buff = fread($fp,1000000); Header("Content-Type: application/x-octet-stream"); // you can put the header file-length here but I never use it! Header("Content-Disposition: attachment; filename=DOWNLOADEDFILENAMEHERE"); echo $buff; this will trigger the download action. joe

« previous php.notes (#21801) next »