+ 1
How to make download button in html?
I want to know how to make download button.
5 odpowiedzi
+ 9
@Harshit Gupta:
Providing the <a> with only an url 'href' attribute without the 'download' attribute will induce browser to firstly try to display it ( load it as a new web document/page ) rather than download the file, according to protocol ( http ) and recognized mime-type ( a 'jpg' file will be displayed, an 'exe' file could be executed on a windows system if user authorized it, and so being just temporarly dowloaded ^^ ). Using 'ftp' protocol can fix it, as it stands for 'File Transfer Protocol'...
+ 6
In the href attribute of <a> tag, provide the complete url of the file. Include any prefixes such as HTTP:// or FTP:// and also include the file extension such as .JPG or .EXE.
+ 2
With Html5, you can use the 'download' flag attribute of <a> html element ( or <area> ), to download a link instead of navigate to it:
<a href="url_of_file_to_download" download>Get the file!</a>
With setting a value to this attribute, you can specify the name wich will be attribute to the dowloaded file on client side...
- 1
<form>
<input type="Button" Value="Button Text"
onclick="window.location.href='download location'
</form>
thats what i know.
- 2
@Achsan Anugrah use input type = "submit"