Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Upload Content Library Item via REST does not work

Hello,

I am trying to upload a content lib item by copying it in the following path:

\\server\c$\ProgramData\Qlik\Sense\Repository\Content\Default\Sam.png

The file is correctly copied in the repository folder.

However, when I access the file in the QMC URL, it's not there :

https://qliksense.domain.local/content/Default/Sam.png

Thank you to please let me know why it is not working, and what does the %RepositoryRoot% stand for in the Content Libraries associated items, like for example: %RepositoryRoot%\Content\Default\Sam.png.

Is it same as  "\\server\c$\ProgramData\Qlik\Sense\Repository\"

Thanks,

Sam

Hello,

In fact what I do not understand is I am trying to upload a content library file through the REST request : /qrs/contentlibrary/{libname}/uploadfile?externalpath={externalpath}&overwrite={overwrite}

It is not working. I have passed my externalpath in this format --> \\server\c$\ProgramData\Qlik\Sense\Repository\Content\Default\Sam.png, still it is not working.

Does anyone know how to upload a content lib item by using this REST request? The link below is not enough helpful I am afraid

http://help.qlik.com/en-US/sense-developer/2.2/Subsystems/RepositoryServiceAPI/Content/RepositorySer...

Thanks,

Sam

3 Replies
elva_lester
Contributor III
Contributor III

I was getting a 403 forbidden error when using the REST API to upload an image to the default content library.  I finally solved the issue by removing the path from the external file name.  I am using a virtual proxy and a session cookie. My request string looks like this:

https://myserver.mydomain.net/myvirtualproxy/qrs/contentlibrary/Default/uploadfile?Xrfkey=8rGQTrtb8n...

I hope this helps.

Elva

robynbitner
Contributor II
Contributor II

Is there any other solution for this? I am experiencing the same problem where when I upload a file, I get the error 403. However, I don't have this problem when I am downloading a file. 

 

I tried to suggestion but then got an error "Missing value for externalpath"

 

Is there some other work around?

bstaniow
Contributor
Contributor

I've found the workaround using @elva_lester solution.

You can request to upload blank image file into content library as follows (suppose you want to upload my_file_name.png):

https://my_server/my_proxy/qrs/contentlibrary/library_name/uploadfile?externalpath=my_file_name.png&...

To upload content your user has to have access to update given content library.

After request is done can check that both empty file and link to it were created in your library folder and QMC.

Then just simply paste your image of choice to the StaticContent/library_name folder and overwrite the my_file_name.png file. Then the link works perfectly with your image.