I know how to use the <a href="file.jpg" download="name">
block in HTML, but I'm afraid that will not work for this project.
I would like to have a download link which will (unsurprisingly) download a file. I would also like a text box on the screen that will allow the user to name the file that thay download.
The site would look something like this:
Name:<input type="text" name="Name" value="Custon Name">
<br>
<button type="button">Download</button>
I want the <button>
block to use onclick"function()"
in order to download the file. The function will get the text from the text box and use it to name the file when downloading it. The thing I need help with is finding a way to name the file using Javascript or JQuery in the same way that download="name"
would.
I've looked for a while for a way to do this, but no luck. Is this project possible? If so, how is it done?