in reply to Cannot get correct filename using CGI

Perhaps you are looking for:
-Content_Disposition=>"filename=filename.txt"

update: why are you using refresh? Is it a splash screen? If not, you could simply:
print $cgi->redirect("$urlfrank");
...and then allow the second cgi to name the file in the output.

-xtype