How to code "content-disposition" so that file modification date is maintained?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

(I posted this to comp.infosystems.www.browsers.misc but there seems to
be very little traffic there.  I can't see another suitable group; is it
on topic here?  If not, any suggestions as to where?)

I'm coding an application which serves out files for download via HTTP.
  I can provide the file name thus


I read in RFC2183 that I should be able to supply the modification date
in that same header, like this

Jan 2006 12:34:56 +0000"

... but I've tried coding that and either I'm making a mistake in the
coding or it's not having the desired effect (using Firefox 1.0.7 and
IE6): the file is saved with the current date and time.  I also tried
the HTTP header

Last-Modified: Fri, 31 Dec 1999 23:59:59 GMT

... but I'm pretty sure that the information in there is for HTTP
caching and not for anything to do with downloaded content.

Can anyone help me with coding this correctly?  (The page is generated
by a Perl CGI script, not that that is relevant to the header content).


Henry Law       <><     Manchester, England

Re: How to code "content-disposition" so that file modification date is maintained?

Quoted text here. Click to load it

Not really on-topic here either.  comp.infosystems.www.authoring.misc
might be better (it's low traffic but it does get read) - Xpost and
Followup set.
Quoted text here. Click to load it

Well, suggest a filename, anyway. Not every browser supports it.

Quoted text here. Click to load it

Looks good.

Well, it's used by HTTP caching *as well*, but certainly at least some
user-agents use Last-Modified to set file timestamps of downloaded
files - a couple of scripts of mine rely on 'wget' doing just that.

I think your best option is to set Last-Modified *and* the extra bit
of Content-Disposition, and if a web browser ignores both of them,
you've done all you can at your end to suggest the timestamp. For
Firefox, try the latest version - 1.0.x is quite old now - and if it
still doesn't work then file a feature request.


Site Timeline