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.
Solved! Go to Solution.
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
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.
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
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.
HI ALL,
Can someone help me on this ?
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
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
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
Hi ,
Thanks for your valuable input.