HTML5 accompanied new APIs, new input type, and in addition new attributes for Forms. One of the upgrades that accompanied HTML5 is the Download attributes.

How about we Start

As we probably am aware, there are numerous documents that are not downloaded specifically. For instance: pictures, web pages, PDF records,  music documents, and so on. We need to right tap on pictures and after that tap on Save Image to save a image file. In any case, in the event that I need to download a picture record straightforwardly, then I need to utilize the download property.

Utilizing the Download Attribute

Basically sort download in the anchor tag. By utilizing this, when we tap on download image, the image begins  downloading. The same strategy is utilized for downloading PDF, web page records (HTML), and so forth. (I am appending a document in which I have demonstrated a correlation between utilizing the download attributeand not utilizing it.)
In the event that we need to give another name to the download file, then we need to write.

Here, we compose download="myImage". When we tap on Download picture, then a picture record is downloaded with  name  myImage with a .png extension. The browser automatically identifies the correct file extension and adds it to the downloaded file. So there is no need to add the file extension in the download attribute.


Naveed Baig

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment