Skip to content

Instantly share code, notes, and snippets.

@cramhead
Last active January 2, 2016 12:29
Show Gist options
  • Save cramhead/8303724 to your computer and use it in GitHub Desktop.
Save cramhead/8303724 to your computer and use it in GitHub Desktop.
load image into CollectionFS
fs = Npm.require('fs');
var loadImages = function() {
var assets_folder = getAssetPath();
var image = fs.readFileSync(assets_folder + '/20131022_GR-Limited-Edition.jpg', 'binary');
//fs.writeFileSync('/Users/cram/Desktop/test.jpg', image, {encoding: 'binary', mode: 777});
var saved = Images.storeBuffer('20131022_GR-Limited-Edition.jpg', image, {encoding: 'binary', noProgress: true, contentType: 'image/jpeg'});
};
loadImages();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment