Re: open/save dialog on page load
| From: | Hellekin O. Wolf | Date: | Wed, 12 Jul 2000 19:28:02 +0000 |
| Subject: | Re: open/save dialog on page load | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6233@lists.php.net to get a copy of this message | ||
<?php
function save_src($url) {
header("Content-Type: application/octet-stream");
readfile($url);
}
save_src($HTTP_SERVER_VARS["PATH_TRANSLATED"]);
?>
You can easily change the MIME-Type as needed (e.g.: application/zip or
application/pdf)
Thank you for pointing me on that problem ;-)
hellekin
Ryan Adams wrote:
>
> Hi all,
>
> How would I cause a php page to bring up the 'open this file from current location/save
> file to disk'
> when a page loads? Like what happens when you click on a zip file or exe or something. I'm
> guessing
> something with header() maybe?
>
> Thanks,
> Ryan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net