Meteor-CollectionFS
Meteor-CollectionFS copied to clipboard
Read a file using CollectionFS
Hi
I'm using CollectionFS for my file uploads, but I'd like to read the file Content.
I heard about createReadStream/createFileStream but I don't get how it works. PortCollection.find().forEach(function (fileObj) { var readStream = fileObj.createReadStream('thumbs'); console.log(readStream); }
It only shows the file Info but I'd like to see the content, how can I do that ?
Regards
any updates on this? i am also wanting to know the same thing
I'm using this snippet and it works for me
var filePath, ref, slugs, url;
url = Images.findOne(imageId).url().split('?')[0];
slugs = url.split('/');
filePath = "/YOUR-SERVER-PATH/" + slugs[3] + "-" + slugs[4] + "-" + slugs[5];