Skip to main content
1-Visitor
November 13, 2019
Solved

Can we Upload Files from REST API into Thingworx Repository?

  • November 13, 2019
  • 2 replies
  • 5501 views

Hi,

 

Can we upload images from REST API or Postman into Thingworx Repository.

I am looking to upload files from Postman. Is thingworx services accept the files ?

Please let me know if it is possible.  

Best answer by slangley

Hi @koushal.

 

Within the context of your original question, yes, the image must be converted.  The sample code in the article initially provided, handles this conversion.

 

However, there are other options available that would not require the Base64 conversion.  For example, you could use the File Transfer Subsystem to transfer files.  Another option would be to use the File Upload widget on a mashup.

 

Please let us know if you have further questions.

 

Regards.

 

--Sharon

2 replies

Community Manager
November 13, 2019

Hi @koushal.

 

Here is an article that may help to answer your question.  Please let us know if you have additional questions.

 

Regards.

 

--Sharon

koushal1-VisitorAuthor
1-Visitor
November 13, 2019

Hi Slangley,

 

I have checked the article. I want to use SaveImage Service but when I am calling from Postman I am getting an Error :No Binary Content specified. PFB the screenshot of Postman call.

I am using Content-Type as multipart/form-data in Headers.

koushal1-VisitorAuthor
1-Visitor
November 17, 2019

HI ALL,

 

 

Can someone help me on this ?

Community Manager
November 21, 2019

Hi @koushal.

 

You will need to use Base64 encoding on the image file.  You can find an encoder/decoder online.

 

Please give this a try and let us know if you still have issues.

 

Regards.

 

--Sharon

koushal1-VisitorAuthor
1-Visitor
November 22, 2019

hi,

 

I am able to save the files into Thingworx Repository if I convert the files into base64 encoding.

But I just want to know that If i am not converting the files into base64 I will not be able to save. Is that true?

In thingworx, we cannot upload the files into File Repository without converting into Base64.

Is it correct? please let me know