Re: How to change a filename for download (e.g. jpeg, pdf etc.)

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

 



Hi,

> Can anyone point me to tutorials on how to change a filename for each
> download? My goal is to give the downloader a random name for a picture or a
> document, so he will never know what the original filename is.

Try adding a Content-Disposition header:

<?php
   header('Content-disposition: attachment; filename=fname.ext');
?>

--
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 23rd January)

-- 
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