I was writing a file download utility in cgi perl and the name of the file downloaded was the same as the name of the perl program used to handle the request. After tinkering around a bit, I found out that adding the following HTTP header allows you to give the downloaded file a name of your choice.

content-disposition attachment; filename=<your file name>