develooper Front page | perl.libwww | Postings from January 2002

LWP::MediaTypes usage for downloads with extension '.hqx'

Norbert Schuler
January 25, 2002 07:19
LWP::MediaTypes usage for downloads with extension '.hqx'
Message ID:

I tried to use LWP::MediaTypes for determing the mime-type of various 
files I offer as downloads and which are sent through a cgi script.

My problem is: The function guess_media_type() within list context 
returns Content-Type "text/plain" and Content-Encoding "x-hqx" for files 
with suffix 'hqx' (with I found is directly implemented in Instead I would prefer the function to return 
Content-Type "application/mac-binhex40" for files with that suffix so 
that Netscape browsers running on windows do not show the files as text 
but offer you to save them to disk.

Is there any reason, why the Content-Encoding ist prefered to the 
Content-Type in function guess_media_type()? My solution now is to 
comment out the line with the Content-Encoding "x-hqx" in 
to make it return the correct Content-Type. Is there a better way?


Haus der Multimedia-Produzenten
Behringstra├če 28a / Haus 2
22765 Hamburg
Tel.: 040/4109879-2
Fax : 040/4109879-9
Mob.: 0174/9609761 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About