[LAU] Under construction

6c62 6c62 at 6c62.net
Mon Dec 14 16:33:44 EST 2009


Hi Will, dear list.

Folderol schrieb:
> On Mon, 14 Dec 2009 00:47:30 -0500
> This is a very curious and frustrating issue, that I've tried for ages
> to get to the bottom of. I have found that Firefox will frequently
> ignore its own 'applications' settings for no apparent reason, but not
> on all sites. Later it may just decide to handle exactly the same site
> correctly!
> 
> Where possible, I've looked at the source of both correctly and
> incorrectly behaving sites and can find absolutely nothing to suggest
> what is happening.
> 
> Some other browsers also seem to have issues with oggs in particular.
> The only two browsers that I've found are consistently correct on this
> issue are (ironically) IE and Opera :o
> 
> If anyone knows what the problem is, I - and I've no doubt a lot of
> others - would be very keen to hear it!
> 
You're right: I, too, have stumbled upon this behavior more than once. I
used to think that it's a result of a "use this option every
time"-confirmation the first time firefox presents a dialog asking what
I want to do with a file. (That's what you refer to with "'appications'
settings.)

I took the opportunity to net-search the issue and found an interesting
discussion at [1]. It seems the browsers' behavior is related to the
HTTP header that is send by the webserver when delivering the requested
file. Using the "content-disposition" header, you can declare a file an
"attachment," which lets firefox open the "save as" dialog.

Since the "content-disposition: attachment;" header is not send
automatically by Apache, you need to somehow add it. In [1], the
recommended way to do it is using a simple PHP script. You can find an
example script in the discussion. If you want to use it though, I'd
strongly recommend to add some security to it. At least, The $_REQUEST
parameter needs to be parsed to make sure the script doesn't accept
requests from a different website. Also, you may want to add a filetype
check to ensure that the script handles mp3/ogg files, only.

Please remember that all I wrote here is plain theory - I didn't test
any of this myself. Hope it helps, anyway.

Best regards,
Lutz

Links:
[1]
http://geeksandgod.com/forum/ministry-technology-q/force-browser-download-mp3s






More information about the Linux-audio-user mailing list