473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

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

(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

Content-Disposition:attachment;filename="somename.dat"

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

Content-Disposition:attachment;filename="somename.dat";mod ification-date="01
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
Apr 22 '06 #1
1 1745
Henry Law <ne**@lawshouse.org> writes:
(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?)
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.
I'm coding an application which serves out files for download via
HTTP. I can provide the file name thus
Content-Disposition:attachment;filename="somename.dat"
Well, suggest a filename, anyway. Not every browser supports it.
I also tried the HTTP header

Last-Modified: Fri, 31 Dec 1999 23:59:59 GMT
Looks good.
... but I'm pretty sure that the information in there is for HTTP
caching and not for anything to do with downloaded content.


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.

--
Chris
Apr 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Justin | last post by:
I have a program that downloads files from the web. There are instances in which a .info() will not return a "Content-length" header to me. Is ther a way to specifically request this header or...
10
by: Blue® | last post by:
I would like to call the content of content.htm (containing only HTML codes) into index.htm. This is usually done by renaming index.htm to index.shtml and use this tag: <!--#include...
10
by: Richard R Plourde | last post by:
Well, the error message... "Please, validate your XML document first! Line 1 Column 1 Content is not allowed in prolog." comes up when I try to verify my CSS...
12
by: Jean-Marc Blaise | last post by:
Hi Folks, I'm getting this message with the XML tutorial: getstart_exportXML.cmd file: SQL0444N Routine "DB2XML.CONTENT" (specific name "DB2XMLCONTENTVF") is implemented with code in library...
0
by: Patrick | last post by:
hi several general webpages (more or less static, e.g. errorpage, timeoutpage etc.) i need in all kind of asp.net-applications. instead of copy this pages (the *.aspx or *.html) into every...
0
by: Brett | last post by:
I have an XML file that is the documentation for an application. Text log files are in a different location than the XML file. For example: c:\adir\errorlog.txt c:\bdir\doc.xml The VB.NET...
21
by: cman | last post by:
does anyone know why i can't generate images with: header("Content-type:image/jpeg"); imagejpeg($img_number); i've tried different examples but i always get a text output as if the header...
0
by: Kevin Frey | last post by:
We have a data-centric application where all of the "layout" for each data centric page is to be codified (ie. it is expressed in C# code rather than being expressed declaratively). This...
1
by: dave8421 | last post by:
Hi, I'm trying to make sense of the definition for "Rendered Content" in current CR for CSS 2.1 Is rendered content what is displayed on the particular media or device? from the...
2
by: arulforum | last post by:
Actually i want to read Eventlog viewer Security log file using C#, in that log file some usernames value are found like N/A so when i read this file all are working fine except n/a when i read N/A...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.