Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

So, I have always used a php file for my download links - sent them to a file that forced a download by setting the content-disposition to attachment and the content-type to application/octet-stream.

 

However most recently I stumbled onto a post about doing it in the .htaccess file by simply adding:

AddType application/octet-stream .mp3
Now, I know absolutely nothing about htacces, but this seems fairly simple to me.
That obviously forces the content-type for all mp3 files to octet-stream.
Which got me wondering (because I know forcing the content-type isn't enough, some browsers still open it in the browser), is there a way of using htaccess to also set the content-disposition.
After a bit of googling around, I didn't find anything that was as simple as that, but have found this:
<FilesMatch "\.(?i:mp3)$">
  ForceType application/octet-stream
  Header set Content-Disposition attachment
</FilesMatch>

 

Which is working a treat on the wordpress site I've just set up - BUT, I just wanted to stop by and ask, is this the best way of doing it?

 

Thanks,

JD.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.