I have an Apache 2.2 running and I am forcing some files to be downloaded using this .htaccess snippet:
<Files *.*>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>
All the affected files are in one subfolder, so this worked nicely so far. Unfortunately it now turns out that this sometimes causes problems (for example, jplayer doesn't like that). I now need to selectively use default behavior, or forced downloads for these files.
I imagine that it must be somehow possible to choose the behavior with an URL parameter, so that
http://example.com/files/music.mp3
would cause normal behavior (i.e. a browser that can play MP3s would do so and jplayer won't complain), and
http://example.com/files/music.mp3?download=1
would force a download. However I can't figure out how I can use ForceType selectively based on the presence of a parameter. I know it would be easily possible with some PHP, but I want to avoid that if possible.
Thanks for any help!