Paul Farr wrote:
> The short version is: I need to master the download stream for a
> file, while delivering it to the enduser, I need to change some bytes
> in the file data. A simple search and replace. I want to do it in the
> stream, don't want to create a new file each time.
Assuming you've a URL along the lines of this:
nnnn.php?file=<filename>
nnnn.php:
<?php
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"whatever.exe\"");
$txt=file_get_contents(the file you want to send)
// do your editing on the string here
print $txt;
?>
/Per Jessen, Zürich
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php