Re: How to define a path of download file in header?
| From: | Abdul-wahid Paterson | Date: | Tue, 18 Mar 2003 23:53:04 +0000 |
| Subject: | Re: How to define a path of download file in header? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140225@lists.php.net to get a copy of this message | ||
On Tue, 2003-03-18 at 23:45, Ruo Zhang wrote:
> I use the following headers to force open a download dialog box. However, my download files are
> located in other directories/subdirectories. How can I specify a download path in the header? The
> 'Content-Location' header does not work in this case. Can someone please help?
>
> header("Content-type: application/octet-stream");
> header("Content-Length: $filelength");
> header("Content-Disposition: attachment; filename=$fname;");
>
Why don't you do:
readfile($filename);
straight after your header statements. That will read in the file and
pass it straight through to the browser.
Regards,
AW
--
Abdul-Wahid Paterson
Lintrix Networking & Communications ltd.
Web: http://www.lintrix.net/
Tel: +44 7801 070621
Email/Jabber: aw@lintrix.net
--------------------------------------------------------------------
Web-Hosting | Development | Security | Consultancy | Domains
--------------------------------------------------------------------
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc