homepage Welcome to WebmasterWorld Guest from 54.211.68.132
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

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



 
Msg#: 4267444 posted 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

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4267444 posted 1:11 am on Feb 16, 2011 (gmt 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.

...

doubleJ



 
Msg#: 4267444 posted 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

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



 
Msg#: 4267444 posted 3:27 am on Feb 16, 2011 (gmt 0)

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

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



 
Msg#: 4267444 posted 1:18 am on Feb 18, 2011 (gmt 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

doubleJ



 
Msg#: 4267444 posted 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

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



 
Msg#: 4267444 posted 6:05 pm on Mar 4, 2011 (gmt 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved