cluster0:filesystem

v0.0.2Published last month

cfs:filesystem

NOTE: This package is under active development right now (2014-3-31). It has bugs and the API may continue to change. Please help test it and fix bugs, but don't use in production yet.

A Meteor package that adds local server filesystem storage for CollectionFS. When you use this storage adapter, file data is stored in a directory of your choosing on the same server on which your Meteor app is running.

Installation

Install using Meteorite. When in a Meteor app directory, enter:

$ meteor add cfs:filesystem

Important Note

Note that using this Storage Adapter on the free Meteor deployment servers on *.meteor.com will cause a reset of files at every code deploy. You may want to have a look at the GridFS Storage Adapter for persistent file storage.

Usage

1var imageStore = new FS.Store.FileSystem("images", {
2  path: "~/app-files/images", //optional, default is "/cfs/files" path within app container
3  transformWrite: myTransformWriteFunction, //optional
4  transformRead: myTransformReadFunction, //optional
5  maxTries: 1 //optional, default 5
6});
7
8Images = new FS.Collection("images", {
9  stores: [imageStore]
10});

Refer to the CollectionFS package documentation for more information.