Force a wmv to download instead of opening in browser

I recently needed to force a WMV to download using Apache. The default behaviour for most browsers is to try to open the movie inside the browser itself. This works fine if the person has the plugin otherwise we just gonna have a blank page. Also for huge WMV is easier to download the file for later viewing.

So just place this on your .htaccess on the root of your website.

1
2
3
4
      <FilesMatch "\.(?i:wmv)$">
      ForceType application/octet-stream
      Header set Content-Disposition attachment
      </FilesMatch>

This will consider any files and it’s not case sensitive, WMV, wmv, WmV are all acceptable.

Leave a Reply