save file without extension
is it possible to save a file without an extension? It seems like if I don't specify one it defaults to .txt
let blob = new Blob([atob(passwordInfo.private_key_base64)], {type: "text/plain;charset=utf-8"});
saveAs(blob, "pk_" + server.name);
try changing/removing the text/plain?
thanks @jimmywarting for the response. That didn't seem to work, unfortunately.
New code:
onClick={() => {
let blob = new Blob([atob(passwordInfo.private_key_base64)], {type: "charset=utf-8"});
saveAs(blob, "id_" + server.name);
}}
Try changing let blob = new Blob([atob(passwordInfo.private_key_base64)], {type: "text/plain;charset=utf-8"}); saveAs(blob, "pk_" + server.name);
The "text/plain" in the original, to be "text/text"
Hi!
I face the same issue, it's only in Chrome (should be in Chromium based browsers, I only tested Chrome). The issue does not happen in Firefox. It's traced in these two issues (and surely some more) :
- https://bugs.chromium.org/p/chromium/issues/detail?id=38213
- https://bugs.chromium.org/p/chromium/issues/detail?id=1503
Given the dates, I have no hope of a fix.
I tried Henry's idea but no luck.
I am downloading an epub toc.ncx file. I got FS to use .ncx file extension by changing "text/plain;charset=utf-8" to "text/ncx;charset=utf-8", using Chrome.
If you want to save a file without an extension you can set the type to application/octet-stream.
I tried using {type : "plain/plain"} and for some reason it worked... I don't know how