NYCPHP Meetup

NYPHP.org

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

Chris Shiflett shiflett at php.net
Thu Jul 17 10:55:20 EDT 2003


--- "DeWitt, Michael" <mjdewitt at alexcommgrp.com> wrote:
> I have been looking around for a way to get browsers to download
> rather than display a GIF file.

Have you looked into the Content-Disposition header? With it you can specify a
filename (convenient when the name of your PHP script isn't the name you want
the browser to use), and you can indicate inline or attachment. You would want
attachment.

Double-check my syntax, but I think it would go something like this:

header('Content-Disposition: attachment; filename=blah.gif');

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/



More information about the talk mailing list