Created
March 9, 2016 19:10
-
-
Save adrianolsk/41d1d7c0a9e72468398a to your computer and use it in GitHub Desktop.
Image url to base64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://atmospherejs.com/froatsnook/request | |
Meteor.methods({ | |
downloadImage: function (imageUrl) { | |
//https://atmospherejs.com/froatsnook/request | |
var result = request.getSync(imageUrl, {encoding: null}); | |
return 'data:image/png;base64,' + new Buffer(result.body).toString('base64'); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment