Описание тега collectionfs
CollectionFS is a suite of Meteor packages that together provide a complete file management solution including uploading, downloading, storage, synchronization, manipulation, and copying. It supports several storage adapters for saving to the local filesystem, GridFS, or S3, and additional storage adapters can be created.
CollectionFS is a suite of Meteor packages that together provide a complete file management solution including uploading, downloading, storage, synchronization, manipulation, and copying. It supports several storage adapters for saving to the local filesystem, GridFS, or S3, and additional storage adapters can be created.
The CollectionFS package makes available two important global variables:FS.File
and FS.Collection
.
- An
FS.File
instance wraps a file and its data on the client or server. It is similar to the browserFile
object (and can be created from aFile
object), but it has additional properties and methods. Many of its methods are reactive when the instance is returned by a call tofind
orfindOne
. - An
FS.Collection
provides a collection in which information about files can be stored. It is backed by an underlying normalMongo.Collection
instance. Most collection methods, such asfind
andinsert
are available on theFS.Collection
instance. If you need to call other collection methods such as_ensureIndex
, you can call them directly on the underlyingMongo.Collection
instance available throughmyFSCollection.files
.
A document from a FS.Collection
is represented as a FS.File
.
CollectionFS also provides an HTTP upload package that has the necessary mechanisms to upload files, track upload progress reactively, and pause and resume uploads.
Read more in the documentation.