A local file system store for UploadFS.
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
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.
import {Mongo} from 'meteor/mongo';
import {LocalStore} from 'meteor/jalik:ufs-local';
// Declare store collection
const Photos = new Mongo.Collection('photos');
// Declare store
const PhotoStore = new LocalStore({
collection: Photos,
name: 'photos',
path: '/uploads/photos',
mode: '0744', // directory permissions
writeMode: '0744' // file permissions
});
let path = PhotoStore.getPath();
let path = PhotoStore.getFilePath(fileId);
This package is released under the MIT License.