Jump to content

Download Links

Recommended Posts

How do I make a download link?

I am unaware of how to get a file link as in the w3 example.

How would you do it?

Please give code with an explanation. I will understand so don't worry if it doesn't seem specific. Just try to give an example of as much as you can.

Link to post
Share on other sites

You can use the HTML download attribute to specify that the target will be downloaded when a user clicks on the hyperlink.

<a href="/images/myw3schoolsimage.jpg" download>
  <img src="/images/myw3schoolsimage.jpg" alt="W3Schools">


Edited by Makwana Prahlad
Explain Code
Link to post
Share on other sites

Right, I saw the w3 tutorial, but say I want to make a button to download a word doc.

How do I get the file link?

The w3 file logo was myw3schoolsimage.jpg

But what do i put instead of /images/

Link to post
Share on other sites

You have to upload the file to your web server. Then the path will be determined by where on the web server you placed the file.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...