How to force download media files on wordpress

How to force download media files on wordpress

How to force download media files on wordpress

For those of you that want to add the features of auto downloading to your wordpress website, for your users to be able to download any media files.

  • Login to your cPanel
  • Click on file manager
  • open puublic_html folder
  • make sure, your hidden files is visible
  • Then, add the below code to your .htaccess file
  • <FilesMatch "\.(mov|mp3|jpg|pdf|mp4)$">
    ForceType application/octet-stream
    Header set Content-Disposition attachment
    </FilesMatch>

    ForceType application/octet-stream
    Header set Content-Disposition attachment
  • Save it and it should be working fine.

If you face any error on this, feel free to drop comment and we are always here to provide help.

DO YOU WANT FREE WORD-PRESS WEBHOSTING CHECK HEREĀ 

Be the first to comment on "How to force download media files on wordpress"

Leave a comment

Your email address will not be published.


*