
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Upload To Content Library
Hi guys,
Has anyone tried to upload files to a content library via the API?
I've found this within the help https://help.qlik.com/en-US/sense-developer/November2022/Subsystems/RepositoryServiceAPI/Content/Sen...
However, I can't figure out where to start? Can anyone provide any advice or example API scripts please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jamelmessaoud ive spend some time on this API when i was working on qlik-repo-api package and can confirm that it took me a bit of time to wrap my head around it. But at the end the api end up being not so complicated ... just not much documentation/examples around it.
Have a look at my implementation of "uploadfile" endpoint - https://github.com/Informatiqal/qlik-repo-api/blob/7efca18a82a72edf1f79c3e09690692baa057946/src/Cont...
The code there is doing a few more extra things and this is specific to my implementation.
But in general to upload file you have to:
- make request to: https://my-sense-server/qrs/contentlibrary/<LIBRARY NAME HERE>/uploadfile?externalpath=<PATH TO THE FILE>
- include Content-Type header with the meme type of the file (ex. image/png)
- the body is of type "multipart/form-data"
PATH TO THE FILE - this tells Qlik how/where to store the file. If you want the file to be in the library root folder then for this param enter the file name. If you want to upload the file to a specific subfolder then inlude the path to that subfolder as well (ex: folder1\folder2\my-file.png).
For example if i pass "test\Image-2024-09-06-0518.png" for the "externalpath" then in QMC i can see:
(In the example above my content library is called "test123")
Hope that this makes it bit more clear 🙂
Stefan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks so much for this @stefanstoichev1
I will let you know how it goes
Thanks again

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Stefan,
Would I be able to achieve this by creating a new Rest connection?
At the moment when trying I get a the following error message
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can make rest calls to the Repository API from within the script. Have a look at all "monitor_XXX" data connections how to setup the authentication.
The problem in this instance (i think) is how to pass the file content to the script and then to the rest body.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah yes of course. I didn't think to check those connections! Thank you.
I am hoping to achieve passing the file content via variables. Just want to get the rest connection working first with manually entered text before I progress to this step... 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Stefan,
Unfortunately, I still cannot get this working 😞
Would you be able to provide some guidance with regards to what needs to be added into the connection setup?
I've tried to enter various things into this and nothing seems to work.. 😞
Any help would be appreciated.
Thanks
