Welcome to WebmasterWorld Guest from 54.198.14.214

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Download Confirmation

Left click download link opens default Open/Save/Cancel Confirmation

     
5:21 pm on Feb 15, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 15, 2011
posts: 53
votes: 0


I think this is an option in apache, but I haven't been able to find it.
I have links to .mp3 files and when you left-click they open up the default media player and play. I want to have it pop open a box asking the user what they want to do, when they left-click.
I know it can be done with javascript, but I'd rather do it server-wide.
JJ
1:11 am on Feb 16, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Aug 29, 2006
posts:1312
votes: 0


You might try setting the MIME type for .mp3 files to application/octet-stream using .htaccess.

I'm not sure this is 100% effective (but if it is it should do what you want).

Welcome to WebmasterWorld.

...
1:54 am on Feb 16, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 15, 2011
posts: 53
votes: 0


I could check into it.
I was looking for an AddHandler to remove from httpd.conf, but there wasn't one for .mp3.
I'm pretty sure that what I want is in the apache configuration. I just need to find it.
JJ
3:27 am on Feb 16, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 11, 2001
posts:5459
votes: 3


The easiest solution is to convert the mp3's to ZIP files, however I'm sure that is not what you desire.

Generally speaking, your looking to control a visitors configured browser action and I'm not aware of any solution.
1:18 am on Feb 18, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


You don't need to "remove an AddHandler" (actually an AddType in this case), just define a new one.

AddType application/octet-stream .mp3

Alternately, you may be able to force a download by using the "Content-Disposition" header:

<FilesMatch "\.mp3$">
Header set Content-Disposition "attachment"
</FilesMatch>

Jim
4:57 pm on Feb 21, 2011 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 15, 2011
posts: 53
votes: 0


Hmmm...
I did AddType in httpd.conf (right underneath a couple other AddType instances), saved, and issued apachectl -k graceful.
When I click an mp3 link, it still just opens windows media player.
Did I miss something?
JJ

Edit...
I also tried the FilesMatch bit and it didn't change.
JJ
6:05 pm on Mar 4, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Delete your browser cache to avoid your browser simply serving the previously-cached .mp3 file and server response. In this case, you may also have to hunt down the media player's cache and delete that, too.

Jim