in reply to Re^4: Problem linking a file in CGI script
in thread Problem linking a file in CGI script

Then, file:// will not work anyway, because file:// urls only work locally. Most likely you will want to use <a href=".../$filename">$filename</a> style links and serve the files to your users through your webserver.