note 6826 modified in copy by ronabop

From: Date: Mon, 02 Oct 2000 10:29:23 +0000
Subject: note 6826 modified in copy by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-5875@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 http://www.php.net/manual/function.copy.php

« previous php.notes (#5875) next »