Re: implementing downloads with php?
| From: | Sean Greenslade | Date: | Fri, 03 Apr 2015 01:33:12 +0000 |
| Subject: | Re: implementing downloads with php? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-324757@lists.php.net to get a copy of this message | ||
On Thu, Apr 02, 2015 at 05:58:49PM -0700, Jeffry Killen wrote:
> When a web page or a resource like an image or javascript file, or css file
> "downloads" it is rendered in the browser. It does not appear as a separate
> file written to the users system. What I am looking for is what might be
> described
> as the opposite of uploading a file.
>
> Thanks for responses
> JK
My suspicion was correct; you're looking to tell the browser that this
is a file to save rather than a file to display. This is accomplished
with headers, which the browser interprets as hints (not commands, as it
is free to ignore them) for what to do with a given page.
A quick google turned up this result:
http://stackoverflow.com/questions/8485886/force-file-download-with-php-using-header
See if that helps.
--Sean