is it possible to receive picture in a REST service

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

is it possible to receive picture in a REST service

Post by 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?
Bob
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: is it possible to receive picture in a REST service

Post by 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..................
Aware IM Support Team
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: is it possible to receive picture in a REST service

Post by Jaymer »

That’s kind of cool.
Looks like you’re gonna solve that Tuesday Bob.
Take an image of how that data structure looks when you get that embedded please. Or attach the uploaded data. Thx
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: is it possible to receive picture in a REST service

Post by BobK »

THANK YOU SUPPORT.


Jaymer et al.
This will be used to allow users to load their pictures into the system via a REST service.

Here is a small sample of the JSON coming into the service:
{"userid":"BobK","userpic":"bobk.jpg#iVBORw0KGgoAAAANSUhE..."}

userid is so I know whose picture it is.
userpic is a file name for the picture, "#" and the Base64 encoding of the picture.
Bob
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: is it possible to receive picture in a REST service

Post by Jaymer »

good to know. thx
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply