Part two of Dan's question is how to specify a file name for dynamic content so that the name of the script that generated the content won't be used as the default. The following worked for me in IE 6.0, Netscape 6.2 and Opera 7.0:
print "Content-type: text/plain\n"; print "Content-Disposition: inline; filename=servers.ini\n\n";
Apparently, if you specify a filename, you don't have to trick IE. (Note that without the filename, "octet/stream" won't trick IE, but Bob's trick does work.)
I found this info at:
http://lists.w3.org/Archives/Public/www-talk/1997SepOct/0011.html
In 1996, they were debating whether the user agent should ignore the specified filename and supply an extension based on the type:
http://lists.w3.org/Archives/Public/www-talk/1996NovDec/0026.html
I changed the content type to text/plain specifically to find out how the debate ended. It looks like MS and W3C both did the right thing.
Katy
On Mon, 24 Feb 2003 09:16:40 -0500, Bob Showalter <[EMAIL PROTECTED]> wrote:
dan wrote:basically, what it does, is it reads info, and supposed to output so the user can download the data it's just output, webserver does support scripts, it outputs the correct data, but my goal is to be able to get the "download file" window up, and be able to store a "servers.ini" file from the data the perl script outputs.
The "download file" dialog is controlled by the browser, so you can't really
*force* it to come up.
However, see sec. 19.5.1 of RFC 2616 at http://www.ietf.org/rfc/rfc2616.txt.
The RFC suggests that using Content-type of "application/octet-stream" in
conjunction with the "Content-disposition" header should result in the "Save
as" dialog appearing.
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]