Re: [PHP-DB] folder creation in php

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

 



Trevor Gryffyn wrote:
It's worth noting that if you're just generating HTML that creates just
a regular old HREF pointing to a regular old file, that the web server
will handle sending out the proper headers.

This isn't always the case. If the file is a CSV file and you don't pass the proper headers (and the proper MIME types are not configured in your Web server), then it may try to display the file as plain text in the browser. I could list other examples.


Also, depending on your browser (*ahem* IE), the browser will try to open many file types in the browser without prompting for download.

Plus, if you use a PHP script to generate content and you want a user to download it, often times, they will end up downloading a file of the name "generate-content.php" for every single download.

With the Content-Disposition header, you can avoid these situations and force the browser to prompt the user to download the file with the correct filename you specify.

--
Regards,
Ben Ramsey
http://benramsey.com

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