[UCLA-LUG] web problem

Chan, Michael J michael.j.chan@intel.com
Tue, 31 Aug 1999 13:49:40 -0700


hrm.. they don't seem to work.. any other ideas?

mike

-----Original Message-----
From: Frederick Lee [mailto:phaethon@fire.csua.ucla.edu]
Sent: Monday, August 30, 1999 10:16 PM
To: linux@linux.ucla.edu
Subject: Re: [UCLA-LUG] web problem


Said "Chan, Michael J" <michael.j.chan@intel.com>;
>this isn't a linux problem, but i think we have enough web-savvy people to
>answer this...
>
>i have a button that saves a file to the person's browser. how do i set
what
>the filename for that downloaded file is?
>
>i set the mime-type to tab-deliminated, and write out lines to the stream,
>but i can't figure out how to set the filename.
>what ends up happening is that the browser assigns its own random filename
>(like those filenames in the cache) to it.
>
>any tips?
>
>thnx,
>mike

What about one of the followings or variations in the HTTP response header?:
Filename: foo.ext
filename: foo.ext
file-name: foo.ext
x-file-name: foo.ext

If not, try to get the CGI to pass to itself a GET style URL that has a PATH
part to it, so that it looks like one big URL.  The part after the last
slash
would be interpreted as the intended filename, I would imagine.  e.g.:
http://quux.com/foo.cgi    -- CGI that generates HTML with a link to
http://quux.com/foo.cgi/blahblah.gif   that would set mime-type and the
data.

Browser would save as "blahblah.gif", since that would like like the real
file name.

Actually, I guess the script could just as well ignore the "/blahblah.gif"
part...


-Fred

_______________________________________________
UCLALUG Linux mailing list - Linux@linux.ucla.edu
http://linux.ucla.edu/mailman/listinfo/linux