I have file object
var File = new File(["aa"], "dek_iv");
can I download this one using JavaScript or jQuery
I have file object
var File = new File(["aa"], "dek_iv");
can I download this one using JavaScript or jQuery
Here is an Example how you can download your file Object.
But this will return nothing since the file size is too small for the system to read.
function downloadFile() {
var file = new File(["aa"], "dek_iv.txt");
var link = document.createElement("a");
link.download =file.name;
link.href = file;
link.click();
}
<button onclick="downloadFile()">Download File</button>
function downloadFile() {
var file = new File(["aa"], "dek_iv.txt");
var link = document.createElement("a");
link.download =file.name;
link.href = file;
link.click();
}
<button onclick="downloadFile()">Download File</button>