Reputation: 580
i'm new to meteor. And i found that there are lost of option available for image storing. And finally i decided to use this package
CollectionFS. But in this package it stores file in collection. I do not want to store image in collection , i just want to upload it in my server folder.
Is it possible? How?
Thanks,
Upvotes: 2
Views: 1271
Reputation: 1934
You are in luck, this is possible! Please refer to the documentation:
https://github.com/CollectionFS/Meteor-CollectionFS
In the Storage Adapter section is refers to cfs:filesystem. This allows you to save to the servers filesystem rather than a collection via GridFS. The Adapter and its documentation can be found here:
https://github.com/CollectionFS/Meteor-CollectionFS/tree/devel/packages/filesystem
The implementation is fairly straight forward with the documentation.
As it points out in the documentation, you can add something like this to your common.js file:
var Images = new FS.Collection("images", {
stores: [new FS.Store.FileSystem("images", {path: "~/uploads"})]
});
This creates an FS.Collection called images which stores the images to a folded called uploads in your project and creates a collection to tie those uploads to. Structucing your project is a bit outside of the scope of your question, but you can get more information about that here:
http://docs.meteor.com/#/full/structuringyourapp
Upvotes: 1