Skip to main content
1-Visitor
June 9, 2016
Solved

Posting Images into the repository via REST call

  • June 9, 2016
  • 3 replies
  • 2578 views

Hi Guys,

I am maybe too quick with the question, but Ill ask anyway.

How can I upload images (or any other file) into the TW repository (default or otherwise since TW7.0) directly through the REST API calls.

Thanks a lot.

Tomas

Best answer by ibanham

Hi

It's possible but takes some effort, you have to base64 encode the file and then include the encoded string as content.

Try the SaveBinary service of a repository Thing to test this out.

Hope this helps

Regards

Ian

3 replies

ibanham1-VisitorAnswer
1-Visitor
June 10, 2016

Hi

It's possible but takes some effort, you have to base64 encode the file and then include the encoded string as content.

Try the SaveBinary service of a repository Thing to test this out.

Hope this helps

Regards

Ian

tcoufal1-VisitorAuthor
1-Visitor
June 10, 2016

Hi

so I am on a good track afterall

I am reverseengineering the service mashup from tw (repository) via Wireshark and it calls imageEncoder first and than relay the encoded message to repository message.

I will test that service. Thanks.

tcoufal1-VisitorAuthor
1-Visitor
June 16, 2016

Yep, we got that going.

Now we are sending photos from mobile devices seamlessly to ThingWorx repository.

And now with TW 7.0 and higher we can choose what ever repository we want (remote disks, SMB, FTP what ever) I am thrilled.