get an jpg image from a mobilefirst http adapter -


im working in mobilefirst adapter (6.3) need pass image url in internarl network file system(example :http://www.up.edu.pe/red_compartir/facebook.png) cant data correctly, img data isnt in text variable: here server side code:

    function getimage(id){             var input = {                     method : 'get',                     returnedcontenttype : 'plain',                     path : '/someurl/someurl2/'+id+'.jpg'                 };             return  {                 out: base64.encode(wl.server.invokehttp(input).text)             };         } 

here client code process de image:

function getimagefrom() {     execmobilefirstadapter("adaptername", "method", ["parameter"]).then(function (data){         wl.logger.debug("ok")         var imagebase = data.invocationresult.out;         document.getelementbyid('imageserver').setattribute( 'src', 'data:image/jpeg;base64,'+ imagebase );     }).fail(function(data){         wl.logger.debug("error");     })  } 

is there way return base64 jpg image mobilefirst adapter?

ive used example: https://www.ibm.com/developerworks/community/blogs/mobileblog/entry/ibm_worklight_adapter_accessing_an_image?lang=en

and works need javascript in server. posible?

is there way return base64 jpg image mobilefirst adapter?

i've used example: https://www.ibm.com/developerworks/community/blogs/mobileblog/entry/ibm_worklight_adapter_accessing_an_image?lang=en

and works need javascript in server. possible?

the easiest approach in fact implement way example in article you've provided.

the other way find javascript lib base64 encoding , try add lib adapter , use it.

note javascript adapters not support adding additional files adapter, means need take entire implementation of whichever lib you'll find , put inside adapter code. not nice. not guarantee it'll work.

additionally, calling adapter inside cordova plug-in? strange. why? why not use wl.client.invokeprocedure api... in article...


Comments