Page 1 of 1

htaccess prevents media files being played from files folder

PostPosted: Tue Jun 03, 2014 12:29 pm
by ningus
Hello,

this is maybe a specific problem in Firefox, as it is quiet strict in terms of mime types.

In my project I upload audio files to /files, these files would be played or streamend ok in every browser but Firefox. Firebug console puts out a warning that example.mp3 cannot be played with mime type text/plain.

The .htaccess in /files looks like this:
Code: Select all
# Force plain text showing
ForceType text/plain
<FilesMatch "(?i)\.(gif|jpe?g|png|zip|tgz|txt|md|docx?|pdf|xlsx?|pptx?|html?)$" >
  ForceType none
</FilesMatch>

I ended up adding |mp3? to the list in FilesMatch. Which solved broken audio in Firefox.

My guess is, that restrictions are there for security reasons. Would it be safe, to add more typical media formats?