baudehlo: I think is working to specify the encoding like this fs.readFile(all_photos[i], 'base64' ,function(err, result){