I trying to get my code to force the download of Video and Audio files on my server. It downloads like I want it to in Chrome but when I do Safari the person has to Right click an download. I know it can be done for Safari cause I have been to sites that starters the download on my computer. Can anyone help me with this code. I want people to be able to download the file but only once. When it is done in Safari it takes me to the webpage for the file and I don't want it to be able to be copied and pasted. So I have it open in a blank page but it still shows in the history.
<p>Select video to upload:
<button onclick="openWin()"; disableButton(btn1) type="button" id="btn1">Click here to download file.</button>
<button onclick="closeWin()">Click here after file downloads.</button>
<script>
var myWindow;
function openWin() {
myWindow = window.open("http://website/subfolder/audio/musicfile.mp3",
"_blank",
"width=500, height=500");
}
function closeWin() {
myWindow.close();
}
Does anyone know how to correct this or have another way that I can get it done securely? I thank everyone for their assistance.