Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create a download file from blob url

// Create Hidden URL in HTML
    var a = document.createElement("a");
    document.body.appendChild(a);
    a.style = "display: none";

// Pass Blob Object
    blob = new Blob([json], {type: "octet/stream"}),
    url = window.URL.createObjectURL(blob);
            
// Append Blob and trigger download
    a.href = url;
    a.download = fileName;
    a.click();
    window.URL.revokeObjectURL(url);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #download #file #blob #url
ADD COMMENT
Topic
Name
3+6 =