in reply to Creating dynamically named CGIs

Full marks to the other posts, but the advice about using "Content-Disposition" headers neglects Netscape 4.x browsers (at least in my experience). To get around this difference in browsers, I have used the following snippet of code, with credit going to Merlyn's web techniques column for the path-info-in-query-string trick:

# determine the http header to send the browser client: my $user_agent = $q->user_agent; # CGI query object if ($user_agent =~ m/MSIE/i) { # for IE users, the following wo +rks: print "Content-Disposition: attachment; filename = $name\n\n"; } else { # for Netscape clients, need to +do a 2-pass trick here... if ($q->path_info() ) { # 2nd pass: collect the extra path info which Netscape client # will use to name the downloaded file: print $q->header('application/x-octet-stream'); } else { # 1st pass: add the name info to the http header path info var # and redirect back upon itself for the 2nd pass: $q->path_info("/$name"); print $q->redirect($q->self_url()); exit; } }

Hope this helps

..Guv