Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.

Posting a file to AwareIM's exposed REST endpoint

Platinum_ar

Is it possible to post a file to the AwareIM REST endpoint that expects a set of different attributes like strings, and a file/document/attachment?
Is there any way in general to transfer binary data? Maybe to a dedicated endpoint that is implemented with a process that requires BO with a file attribute only?


himanshu

It is doable with some external plugin. PM me more details what you want to achieve.


aware_support

It is possible even without a plugin. Aware IM REST does support binary data.


himanshu

Now that’s something new to me... I might missed the class... can you share the document or link for reference?


aware_support

This should be explained at the end of the tutorial about consuming REST services.


himanshu

ok I think it is not supported when we exposed REST API and that's what I was saying.


BobK

The following, from is it possible to receive picture in a REST service (comment)

From Bobk
I am trying to expose a REST service in my AwareIM application that accepts a picture, but I can not get it to work.

In my testing, I am sending the picture as base64 encoded. The tomcat log file has the following error: "Invalid format of binary representation for attribute myPic"

Is this possible in the latest version of AwareIM (version 8.4 build 2722)?
If so, what format does the picture data need to be in?

From aware_support
Yes, it is possible. The data for the picture should start with the file name, then a delimiter # and then Base64 encoding of the picture, for example:

myPicture.png#aa2342bb33..................


himanshu

Thanks Bob,

It is going to be useful but this would not work when data is pushed as multi-form-part.

Still good to know at least there is a way.