|
Posted by Richard Lynch on 10/16/61 11:16
On Mon, May 16, 2005 5:49 pm, Miguel Vaz said:
> Was coding a directory listing for several dirs on a client's server that
> would list the files and allow users to download them. The question is, is
> there a way to force download of all files, regardless of their types?
> i.e., if the list constains a .jpg, the browser will show it instead of
> asking the user to download. Also for .html, gifs, etc.
<?php
header("Content-type: application/octet-stream");
readfile("/full/path/to/your/file");
?>
Any browser that doesn't force a download for application/octet-stream is
in violation of every HTTP protocol version ever published.
Even *MICROSOFT* hasn't screwed this one up. Yet...
--
Like Music?
http://l-i-e.com/artists.htm
Navigation:
[Reply to this message]
|