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.
var filepath = app.activeDocument.path + '/' + name + '.png';
//get file buffer
var f= new File(filepath);
f.encoding = 'BINARY';
var buffer = f.read(f.length);
//file buffer to base64
var base64 = base64Encode(buffer);
I guess base64Encode() function not exists. I don't see your definition in your code and Photoshop script core is a bit old and think it doesn't has built-in function for that.
You could google old school method for base64 conversion. Something like: Base64.js/base64.js at master · davidchambers/Base64.js · GitHub but you should do some modifications.
For sending you also could use HTML panel and make some Ajax request or something. Or use "Socket" class in JSX (TCP/IP connection)
Or If you have public IP or If you want use it in LAN then you can use Connection SDK.