Re: Semi-newbie Question .... streams ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux