Re: MIME type
| From: | Angelo Zanetti | Date: | Wed, 12 Sep 2007 09:08:22 +0000 |
| Subject: | Re: MIME type | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-261998@lists.php.net to get a copy of this message | ||
Thanks heavyccasey
Im not sure which comment you are referring to, perhaps this one? There are many posts.
|<?php
$file = '/var/www/html/file-to-download.xyz';
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Length: ' . filesize($filename));
header('Content-Disposition: attachment; filename=' . basename($file));
readfile($file);
?>|
heavyccasey@gmail.com wrote:
Look up readfile(); Make sure you read the comments. On 9/11/07, Angelo Zanetti <angelo@zlogic.co.za> wrote:-- ------------------------------------------------------------------------ Angelo Zanetti Systems developer ------------------------------------------------------------------------ *Telephone:* +27 (021) 552 9799 *Mobile:* +27 (0) 72 441 3355 *Fax:* +27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* angelo@zlogic.co.za <mailto:angelo@zlogic.co.za>Hi guys.I am linking to a file on a WAP site. the backend is written in PHP. However I need to link to a file but set the content type. I've done the following and am wondering if this is correct: <? // We'll be outputting a PDF header('Content-type: application/vnd.symbian.install'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename="../File/norEnglish.sis"'); ?> So basically I set the HREF to the file above (filename .php). Let me know if there is anything that im doing incorrectly. Thanks -- ------------------------------------------------------------------------ Angelo Zanetti Systems developer ------------------------------------------------------------------------ *Telephone:* +27 (021) 552 9799*Mobile:* +27 (0) 72 441 3355 *Fax:* +27 (0) 86 681 5885* Web:* http://www.zlogic.co.za *E-Mail:* angelo@zlogic.co.za <mailto:angelo@zlogic.co.za> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php