1 Reply Latest reply on Nov 25, 2016 10:25 AM by Jarda Bereza

    Photoshop Scripting: How to convert psd image in base64 in jsx to send it on server

    avinashk17620225

      I am working on a photoshop plugin. I want to convert the photoshop psd file in Base64 so that I can send it on my server. But this following code is not running. It gives EvalScript Error.

      <pre>

      var filepath = app.activeDocument.path + '/' + name + '.png';

        //get file buffer
        var f= new File(filepath);
        f.open();
        f.encoding = 'BINARY';
        var buffer = f.read(f.length);
        f.close();

        //file buffer to base64
        var base64 = base64Encode(buffer);

        return base64;

      </pre>