![]() ![]() ![]() Question: What would be use case for this? Isn't it logical to name your file how you want it to be downloaded? So if there is a specific browser you're targeting, make sure you check compatibility before using this attribute.Ĭan I Use: Download attribute # What's the use case for passing a new filename? This feature is not supported by all browsers (cough cough IE). You can learn more about this policy on the MDN Web Doc # Browser Support Let's take a look at an example: Origin: So what does that mean for our download attribute? Well, it means that users can only download files that are from the origin site. This policy is a security mechanism that helps to isolate potentially malicious documents and reduce possible attack vectors. This attribute follows the same rules outline in the same-origin policy. ![]() In other words, you can only download files that belongs to that website. So if the href is not the same origin as the site, it won't work. The download attribute only works for same-originl URLs. Download with original filename -> samanthaming.pngĭownload with custom filename -> logo.png ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |