Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extension Code to write in a text file

Hi  ,

I am trying to write an extension to save in a file.

The same is working on chome html sample.

But but not working on SENSE....any idea

function saveTextAsFile()

{

    var textToSave = document.getElementById("inputTextToSave").value;

    var textToSaveAsBlob = new Blob([textToSave], {type:"text/plain"});

    var textToSaveAsURL = window.URL.createObjectURL(textToSaveAsBlob);

    var fileNameToSaveAs = document.getElementById("inputFileNameToSaveAs").value;

    var downloadLink = document.createElement("a");

    downloadLink.download = fileNameToSaveAs;

    downloadLink.innerHTML = "Download File";

    downloadLink.href = textToSaveAsURL;

    downloadLink.onclick = destroyClickedElement; // assume this method is available

    downloadLink.style.display = "none";

    document.body.appendChild(downloadLink);

    downloadLink.click();

}

1 Reply
Not applicable
Author

When writing extension at times, the code does not work on the Desktop Sense app, however the same works on Browse

So please test directly on thebrowser
http://localhost:4848/hub/