cgi problem: redirecting user to file
first the script does some usual stuff to read the queery string and put the paramaters into variables, which works fine, then i've got this:
if ( $auto ne 0 ){
print "Location: $url\n\n";
}
else{
print "Content-type: text/html\n\n";
print "<html><head><title>Download</title>\n<style type=\"text/css\">\n<!--\nA { text-decoration:none; font-size:8pt; font-family:verdana\n-->\n</style>\n</head>\n<body bgcolor=#dcd5ca text=#685B48 link=#685B48 vlink=#685B48 alink=#685B48 style=\"font-family:verdana\">\n";
print "<center><br>\n<a href=\"$url\">Click here to start download</a>\n</center></body></html>\n";
}
it works fine when i specify auto=0, but now for some reason when it auto-redirects it shows the file as text in the browser. and all code above this has not been modified from the original. someone suggested i set the content type to application/octet-stream before redirecting, but then the browser simply prints out "Location: " thne the url.
can anyone help?

