html - Making a webpage automatically initiate an audio file download -
i trying create page on site such when user lands on page sound file download initiated.
i attempted putting next code in between header tag
<meta http-equiv="refresh" content="1; url=myaudiofile.mp3">
however, doesn't start automatic download after 1 second, rather redirects user www.mywebsite.com/myaudiofile.mp3. essentially, result in sound beingness streamed opposed beingness downloaded.
how can modify code create mp3 file automatically download opposed having streamed?
note: reason why beingness done because there email goes out "download sound file" button. want url of button point page automatically download sound file without user having click on download button.
the web-server can configured handle *.mp3 files mime type downloaded.
instead of audio/mpeg
mime-type can set application/octet-stream
.
for apache can configure on per-directory basis using .htaccess file.
option 1)
<filesmatch "\.(?i:mp3)$"> forcetype application/octet-stream header set content-disposition attachment </filesmatch>
option 2)
addtype application/octet-stream .mp3
html download meta-tags url-redirection
No comments:
Post a Comment