You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Paul Harrison <cu...@austin.rr.com> on 2005/09/13 17:26:05 UTC

Mime Type

Is there a way I can change the mine type in apache so when a user clicks on
a mp3 link it would pop_up the save window instead of playing it ? 

Maybe trick the browser into thinking the mp3 file is a zip file so it will
pop_up a save as window, so the user can save it to their desktop.

 

 

 

Cure


Re: Mime Type

Posted by Tom Schindl <to...@gmx.at>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Harrison wrote:
> So what's the best mime-type then to use ?
> 
> 
> Paul
> 

http://philringnalda.com/blog/2001/12/force_the_browser_to_save_a_file.php

- ----------------8<----------------
$r->content_type("application/octet-stream");
- ----------------8<----------------

... as already stated but you don't need mod_perl for that it would add
too much overhead simply use mod_mime like Chris stated inside a vhost.

Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFDJwWUkVPeOFLgZFIRAoIhAJsGjMMAKZrb1fHQMnX1wTKUUTVeIgCeKifp
ZYLkqOZ5+Wc4WzI4usbKsnk=
=gR3/
-----END PGP SIGNATURE-----

RE: Mime Type

Posted by Paul Harrison <cu...@austin.rr.com>.
So what's the best mime-type then to use ?


Paul

-----Original Message-----
From: Tom Schindl [mailto:tomAtLinux@gmx.at] 
Sent: Tuesday, September 13, 2005 11:32 AM
To: Paul Harrison
Cc: modperl@perl.apache.org
Subject: Re: Mime Type

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As already said that's nothing specific to mod_perl but when using
mod_perl you set the mime-type yourself using:

$r->content_type('text/plain');

If you want the user to have get a popup you have to use a content-type
the browser has no mapping for.

Tom

Paul Harrison wrote:
> Is there a way I can change the mine type in apache so when a user
> clicks on a mp3 link it would pop_up the save window instead of playing
> it ?
> 
> Maybe trick the browser into thinking the mp3 file is a zip file so it
> will pop_up a save as window, so the user can save it to their desktop.
> 
>  
> 
>  
> 
>  
> 
> Cure
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFDJv8UkVPeOFLgZFIRAnzbAJ9GBgR9eXtc7oRCwBLdcGsQ/IRKiwCfWR0Q
3myMfAbiJSoPyryAvxnxjqo=
=LwdO
-----END PGP SIGNATURE-----


Re: Mime Type

Posted by Tom Schindl <to...@gmx.at>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As already said that's nothing specific to mod_perl but when using
mod_perl you set the mime-type yourself using:

$r->content_type('text/plain');

If you want the user to have get a popup you have to use a content-type
the browser has no mapping for.

Tom

Paul Harrison wrote:
> Is there a way I can change the mine type in apache so when a user
> clicks on a mp3 link it would pop_up the save window instead of playing
> it ?
> 
> Maybe trick the browser into thinking the mp3 file is a zip file so it
> will pop_up a save as window, so the user can save it to their desktop.
> 
>  
> 
>  
> 
>  
> 
> Cure
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFDJv8UkVPeOFLgZFIRAnzbAJ9GBgR9eXtc7oRCwBLdcGsQ/IRKiwCfWR0Q
3myMfAbiJSoPyryAvxnxjqo=
=LwdO
-----END PGP SIGNATURE-----

Re: Mime Type

Posted by Chris Croome <ch...@webarchitects.co.uk>.
Hi

I'm not quite sure how this relates to mod_perl...

On Tue 13-Sep-2005 at 10:26:05AM -0500, Paul Harrison wrote:
> Is there a way I can change the mine type in apache 

Yes:

  AddType application/octet-stream .mp3

  http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addtype

I'd suggest just using this for the VirtualHost that you want to
change...

Chris

-- 
Chris Croome                               <ch...@webarchitects.co.uk>
web design                             http://www.webarchitects.co.uk/ 
web content management                               http://mkdoc.com/