You are here: Re: [PHP] php file list with forced download « PHP « IT news, forums, messages
Re: [PHP] php file list with forced download

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация