in reply to Sending named files via CGI
Even though this is in the places merlyn mentioned above ... if you search for it...
Most browsers will typically use whatever is after the last / in the url. So, it you go to http://mydomain.com/cgi-bin/mycgi it will try to download and save the file as "mycgi". To take care of this (assuming you are using Apache), just add on another file name. For example http://mydomain.com/cgi-bin/mycgi/myrealfilename.txt . Apache will parse up the directory tree until it finds an executabe, in this case "cgi-bin/mycgi". After that the rest will get stuffed in the variable $ENV{PATH_INFO}. In this case $ENV{PATH_INFO} would contain "/myrealfilename.txt". If you begin the download when the file matches http://mydomain.com/cgi-bin/mycgi/myrealfilename.txt the user will be prompted to save "myrealfilename.txt".