Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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

Re: Extension Code to write in a text file

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/