Reputation: 888
hi guys i am using ostrio:files package, i want to insert an image on the server side and get the image ID to input for my other data. But i couldn't find any documentation on insert the image to the collectoin on the server side
Upvotes: 1
Views: 715
Reputation: 256
Meteor-Files documentation for uploading files from server -- https://github.com/VeliovGroup/Meteor-Files/wiki/Write
Images.write(binaryData, {
fileName: 'something.png',
type: 'image/png',
meta: {owner: this.userId}, // or whatever you want to add
}, (error, fileRef)=> {
// do stuff with fileRef
});
Also worth checking out jalik:ufs
for an alternative package -- actively maintained and currently being used by RocketChat.
Upvotes: 1