cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we Upload Files from REST API into Thingworx Repository?

SOLVED
Highlighted
Regular Member

Can we Upload Files from REST API into Thingworx Repository?

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.  

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Can we Upload Files from REST API into Thingworx Repository?

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

View solution in original post

9 REPLIES 9

Re: Can we Upload Files from REST API into Thingworx Repository?

Hi @koushal.

 

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

 

Regards.

 

--Sharon

Re: Can we Upload Files from REST API into Thingworx Repository?

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.

Re: Can we Upload Files from REST API into Thingworx Repository?

Hi @koushal.

 

What happens when you select the "binary" option instead of the default of "form-data"?

 

Have you checked the ThingWorx logs located under \ThingworxStorage\logs for any additional information on the failure?

 

Regards.

 

--Sharon

Re: Can we Upload Files from REST API into Thingworx Repository?

Hi Slangley,

 

I have checked the thingworx logs too but the same message "No  binary conent specified" was logged into Script and Script Error Log.

Also, I have tried with Binary option but I got the same result.

 

 

Re: Can we Upload Files from REST API into Thingworx Repository?

HI ALL,

 

 

Can someone help me on this ?

Re: Can we Upload Files from REST API into Thingworx Repository?

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

Re: Can we Upload Files from REST API into Thingworx Repository?

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    

Re: Can we Upload Files from REST API into Thingworx Repository?

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

View solution in original post

Re: Can we Upload Files from REST API into Thingworx Repository?

Hi ,

 

 

Thanks  for your valuable input.

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________