NYCPHP Meetup

NYPHP.org

[nycphp-talk] Anyway to force a download of GIF file?

Jerry Kapron nyphp at NewAgeWeb.com
Thu Jul 17 12:11:37 EDT 2003


Mike,
Try this:

<?
    header('Content-type: application/force-download');
    header('Content-Disposition: attachment; filename=filename.gif');
    readfile('/dir/file.gif');
?>

cheers,
Jerry

--
42.7% of all statistics are made up on the spot. 


-----Original Message-----
From: DeWitt, Michael <mjdewitt at alexcommgrp.com>
To: NYPHP Talk <talk at lists.nyphp.org>
Date: Thursday, July 17, 2003 10:44 AM
Subject: [nycphp-talk] Anyway to force a download of GIF file?


>I have been looking around for a way to get browsers to download rather than
>display a GIF file.  I have tried playing with the TYPE attribute, but it
>seems to be ignored in favor of the file's actual extension.  Yes, I could
>zip the file, but would rather avoid that as well, since my customers will
>find it confusing (believe me).
>
>Any ideas of how to structure a link to fool the browser into starting a
>download dialog?
>
>Thanks in advance.
>
>Mike
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030717/3c06870c/attachment.html>


More information about the talk mailing list