i want to make a download link of video file
-
Hello,
To create a downloadable URL, upload the file to the document route of any domain. If the default
document route is, for example, public_html, copy or move the desired files there. Then, enter the
following in your browser's search bar:
http://domain_name.com/file_name
Any file type can be easily downloaded. Ensure that the domain is live and the ownership is set to
'user.user'0 -
There are a number of ways of forcing a download of a file (@MileWeb 's contribution doesn't actual help in anyway and feels AI generated.)
The easy way would be, in your HTML file, to use the "download" attribute of the "a" tag - for example:
<a href="mymusic.mp3" download>
or as:
<a href="mymusic.mp3" download"="Sample from my site - mymusic by jeff bloggs.mp3">
if you want them to download it with a different/longer filename
However, you may be using a content management system (CMS) which does not allow you to mark links as "downloads" in this manner - or may wish to support older browsers which don't support that tag (less than 3% of active browsers according to https://caniuse.com/download ). In those cases, and perhaps as a backup in case you forget the "download" attribute, ensure all the files you wish to "force download" on are in a single directory/folder (for example /to-download/ ) and in File Manager, create or open a file called .htaccess in that directory. In that .htaccess file add :
<FilesMatch "\.(mp3|mp4|avi)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>Adding/removing change any file extensions as possible. Then whenever files in that folder ending in those extensions are accessed, the browser will be "encouraged" to download the file .
0
Please sign in to leave a comment.
Comments
2 comments