Welcome to WebmasterWorld Guest from 54.227.82.149

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Download Confirmation

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

     

doubleJ

5:21 pm on Feb 15, 2011 (gmt 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

Samizdata

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

WebmasterWorld Senior Member 5+ Year Member



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.

...

doubleJ

1:54 am on Feb 16, 2011 (gmt 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

wilderness

3:27 am on Feb 16, 2011 (gmt 0)

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



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.

jdMorgan

1:18 am on Feb 18, 2011 (gmt 0)

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



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

doubleJ

4:57 pm on Feb 21, 2011 (gmt 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

jdMorgan

6:05 pm on Mar 4, 2011 (gmt 0)

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



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
 

Featured Threads

Hot Threads This Week

Hot Threads This Month