is there a way to prevent a browser from opening an mp3 in a new browser window?
i have a normal link to mp3 file like
<a href="link_to_mp3">some.mp3</a>
and of course you can download it with right click -> save as. but some users don’t know that. so if they click on a link, a new window opens where they can listen to that mp3.
issue is, i want the users to download the files once instead of listen to them thousand times over my server 😉
Through html only you cannot force the link to open a file save dialog.
Instead you can achieve that through
PHPand with some custom headers as seen hereA simple download.php file could look like:
Where you can specify the directory where all your files as saved, as well as a download rate if needed to limit the speed at which the file can be downloaded.
Update
Forgot to mention that you will then change your links to:
where test.mp3 will be changed to your particular download