Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
daviddiener
Partner - Contributor II
Partner - Contributor II

Store data as QVD or attached file via mashup

Hello,

I want to upload a .xlsx file via a mashup and import it to my Qlik Sense App. Which Qlik API has the capability to do that? Either a direct store in the library as .qvd or attaching the .xlsx file to the app (lib://AttachedFiles/) would work.

Thanks in advance!

 

David

Labels (3)
1 Solution

Accepted Solutions
daviddiener
Partner - Contributor II
Partner - Contributor II
Author

I did it by sending a POST request to the QRS API. It is documented here: https://help.qlik.com/en-US/sense-developer/September2020/Subsystems/RepositoryServiceAPI/Content/Se...

Here is my JS Code:

var baseUrl = "https://my-qliksense-server.com/qrs/appcontent/<App-id>"
var url = baseUrl + "/uploadfile?externalpath=myFile.xlsx&overwrite=true&xrfkey=abcdefghijklmnop"
    
var xmlHttp = new XMLHttpRequest()
xmlHttp.open( "POST", url, false ) // false for synchronous request
xmlHttp.setRequestHeader("X-Qlik-XrfKey", "abcdefghijklmnop")
xmlHttp.send( bodyData )

The X-Qlik-XrfKey (16-digits) has to match the xrfkey query parameter. (https://help.qlik.com/en-US/sense-developer/September2020/Subsystems/RepositoryServiceAPI/Content/Se...

The bodyData is a BLOP.

View solution in original post

2 Replies
ajaykakkar93
Specialist III
Specialist III

Hi @daviddiener ,

I have not performed this, for now, ill surely give it a try.

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

daviddiener
Partner - Contributor II
Partner - Contributor II
Author

I did it by sending a POST request to the QRS API. It is documented here: https://help.qlik.com/en-US/sense-developer/September2020/Subsystems/RepositoryServiceAPI/Content/Se...

Here is my JS Code:

var baseUrl = "https://my-qliksense-server.com/qrs/appcontent/<App-id>"
var url = baseUrl + "/uploadfile?externalpath=myFile.xlsx&overwrite=true&xrfkey=abcdefghijklmnop"
    
var xmlHttp = new XMLHttpRequest()
xmlHttp.open( "POST", url, false ) // false for synchronous request
xmlHttp.setRequestHeader("X-Qlik-XrfKey", "abcdefghijklmnop")
xmlHttp.send( bodyData )

The X-Qlik-XrfKey (16-digits) has to match the xrfkey query parameter. (https://help.qlik.com/en-US/sense-developer/September2020/Subsystems/RepositoryServiceAPI/Content/Se...

The bodyData is a BLOP.