Meteor-Community-Packages/Meteor-CollectionFS

How to insert base64 string into newFile.attachData() ?

stuurgurs opened this issue · 1 comments

Hello! I store images in my mongo collection in base64 strings and now i want to migrate to FS.collection.
I need to make this operation:
var newFile = new FS.File();
newFile.attachData(img, {type: 'image/jpeg'});
Images.insert(newFile)

but newFile.attachData() do not underatand base64
when i`m trying to convert it to binary with atob() i get: Uncaught Error: DataMan constructor received unrecognized data string

How i can solve this?

You could use a method. Related #803 (comment)