Forum Moderators: coopster & phranque

Message Too Old, No Replies

print location problems after moving from webhost

         

jpveen

7:52 pm on Aug 8, 2005 (gmt 0)



I have a cgi/perl script that I moved from Unix (Apache) webhost to Windows (IIS6.0) webhost.

My script does a redirect (print Location: $location) of a choosen MP3 file. Website visitors must be able to do a right mouse click on the link to the CGI/perl script and choose the "Save target as" to save the MP3 file instead of listening to it.

And now comes the problem: with the Windows-IIS webhost the visitors get the script-name as a filename when choosing "Save target as" instead of the MP3 filename! (In Apache the same action resulted in the MP3 filename.)

When I analyse the headers the webserver produces there is a big difference. Apache produces a "302 Found" with a location, and this works ok, but IIS produces a "200 OK" and this is apperently interpreted different by the browser!

Can anyone help? Thanks very much!

Header produced by Win/IIS server:
HTTP/1.1 200 OK
Connection: close
Date: Fri, 05 Aug 2005 08:45:43 GMT
Content-Length: 9351474
Content-Type: audio/mpeg
Content-Location: [sub.example1.nl...]
Last-Modified: Fri, 05 Aug 2005 00:00:50 GMT
Accept-Ranges: bytes
ETag: "63c556bd5099c51:580a4"
Server: Microsoft-IIS/6.0

Header produced by Unix/Apache server:
HTTP/1.1 302 Found
Date: Fri, 05 Aug 2005 08:43:02 GMT
Server: Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7e
Location: [sub.example2.nl...]
Content-Length: 255
Connection: close
Content-Type: text/html; charset=iso-8859-1

The script is the same, it's called gkvl_o_a.html and includes the line print "Location: $SRC\n\n"

Thanks to anybody who can help me out!

Jan-Pieter

[edited by: jatar_k at 8:13 pm (utc) on Aug. 8, 2005]
[edit reason] generalized [/edit]

mikeyb

9:14 am on Aug 9, 2005 (gmt 0)

10+ Year Member



Hi,

This wont be much help I know, but I've used print locations fine with Windows & IIS5

print "Location: \infopage.htm\n\n";

WWMike

9:58 pm on Aug 10, 2005 (gmt 0)

10+ Year Member



Probably a difference in MIME type server configuration.

Try manually changing the header from:

Content-Type: audio/mpeg

to:

Content-Type: text/html