UploadFS Local Store
A local file system store for UploadFS.
Installation
To install the package, execute this command in the root of your project :
meteor add jalik:ufs-local
If later you want to remove the package :
meteor remove jalik:ufs-local
Creating a Store
The code below is available on the client and the server.
Specify the path where you want to save the files. Be aware that you must not change the path, neither the name of the store if you have already saved files or you will break the URLs.
1import {Mongo} from 'meteor/mongo'; 2import {LocalStore} from 'meteor/jalik:ufs-local'; 3 4// Declare store collection 5const Photos = new Mongo.Collection('photos'); 6 7// Declare store 8const PhotoStore = new LocalStore({ 9 collection: Photos, 10 name: 'photos', 11 path: '/uploads/photos', 12 mode: '0744', // directory permissions 13 writeMode: '0744' // file permissions 14});
Getting store local path
1let path = PhotoStore.getPath();
Getting file path
1let path = PhotoStore.getFilePath(fileId);
License
This package is released under the MIT License.