Ask Question. Asked 10 years, 5 months ago. Active 7 years ago. Viewed k times. Improve this question. RivieraKid 5, 4 4 gold badges 36 36 silver badges 47 47 bronze badges. Setting the content type should do it. Which browser is it? Which browser? Octet-stream should be the right answer, but older versions of IE used to try and "sniff" the content type regardless of what the web server was telling it — Paolo.
Content-Disposition attachment will do it. Add a comment. Active Oldest Votes. Therefore, your method should be written as follows this won't compile as it is a mere representation : response. Improve this answer. Vineet Reynolds Vineet Reynolds ChristopheRoussy, yes no one claimed as such. Stop spamming all the answers here. I want to inform other SO users about it being a hack and how it works as this is not mentioned anywhere, here is an explanation on SO: stackoverflow.
Vladimir Dyuzhev Vladimir Dyuzhev I would guess it is "you're doing everything correctly" that burned you. The code below will tell the browser to prompt the user to save the file. This link does not have the download attribute. This link has the download attribute. Read More From Actual Wizard Understanding the Different Parts of an Email Address An email address has four parts; the recipient name, the symbol, the domain name, and the top-level domain.
There are a number of different ways to get the last element of an array in JavaScript. Below we will explore …. How to use document. Active Oldest Votes. This is something that you cannot absolutely control with HTML itself.
Improve this answer. Community Bot 1 1 1 silver badge. Kostas Rousis Kostas Rousis 5, 1 1 gold badge 30 30 silver badges 36 36 bronze badges. Though, Here's the compatibility table of download attribute.
This must be known. HTML 5 download attribute did this.. There is nothing wrong with the correctness of the answer. It is just not useful.
The fact that you find it cumbersome to wade through all possible duplicates only illustrates my point, there is no need for yet another duplicate that adds to the pile of possible duplicates. Doesn't work for me in Safari 8. ChrisWesseling down voting the answer because the question is a dupe sounds ridiculous, why does that have anything to do with the answerer? It'd be one thing if he copied an answer on the same question , but this is not that case.
Actually this post comes up first on Google AND has more up votes by an order of magnitude than the one you linked to. Down voting is not a mechanism for "flagging as a duplicate", it's a mechanism for down voting.
0コメント