Dan wrote: > > so, i click on a link which goes to download.pl, and instead of the data > the script outputs going to the browser, i want it to be saved as a file, > servers.ini, as if you've right-clicked the link and put "save target > as...". at the moment, doing "save target as..." says the file name is > "download.pl", but i want that to read "servers.ini". > > my question is: is it possible to tell explorer that the data the script > is outputting belongs to a file named servers.ini, not a file named > download.pl, or the text just appearing straight in the browser? > if not, is there another way where i can create data on the fly, give the > user the file, and remove the file straight after? >
yes, i think it's possible(to some degree). if you return something(Content-type) that IE doesn't understand, the standard "Save As ..." box is pop up. for example, if i have the following: #!/usr/bin/perl -w use strict; #-- #-- stime.pl #-- print "Content-type: something/ie_doesnt_understand\r\n\r\n"; print "It's ",scalar localtime,"\n"; __END__ and then when i point IE to the script: http://my_machine/stime.pl i will get a "Save As ..." box that lets me save the content of the return value. i save it as servers.ini and then open servers.ini in Notepad, i will see: Fri Feb 21 18:18:32 2003 of course, your script will actually generate the content of servers.ini instead of just a time :-) i think you get the idea. note: i am not a windose/ie fan so i could be wrong about how ie handles those situation. david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]