cancel
Showing results for 
Search instead for 
Did you mean: 

GET request on base64 Alfresco

pat9rv3sousa
Champ on-the-rise
Champ on-the-rise
I'm trying to make a file request with this:


var connector = remote.connect("alfresco");
result = connector.get(PATH TO THE FILE);
    if (result.status == 200)
    {
        var data = result;
    }


And I get the all content of PDF in binary format. I want to convert to base64 but I want that the server make this before return the response. Anyone know how to make this?

I accept other type of resolutions without being with connector but XMLHttpRequest or Alfresco. or YAHOO.util.Connect.asyncRequest('GET,url,callback) don't works in server javascript, are undefined, so, I only know this resolution to get content.
3 REPLIES 3

angelborroy
Community Manager Community Manager
Community Manager
There is no out of the box Web Script in Alfresco returning base64 content. You need to develop your own webscript or to make the transformation to base64 in javascript (maybe this https://gist.github.com/ncerminara/11257943 can work with Rhino JS).
Hyland Developer Evangelist

It worked thanks.

It worked thanks.