Meteor-Files Documentation
September 24, 2025 ยท View on GitHub
Explore documentation and examples for files' upload and its custom integration into Meteor.js application
ToC:
Browse documentation directory or navigate using lost of links below.
About:
Meteor-Files library features and highlights
- Event-driven API
- TypeScript Definitions
- Upload / Read files in Cordova app: Cordova support (Any with support of
FileReader) - File upload:
- Upload via HTTP or DDP, read about difference
- Ready for small and large files (optimized RAM usage)
- Pause / Resume upload
- Auto-pause when connection to server is interrupted
- Parallel multi-stream async upload (faster than ever)
- Support of non-Latin (non-Roman) file names
- Use third-party storage:
- AWS S3 Bucket Integration
- DropBox Integration
- GridFS using
GridFSBucket - GridFS using
gridfs-stream(legacy) - Google Drive
- Google Cloud Storage Integration
- any other with JS/REST API
- Get upload speed
- Get remaining upload time
- Serving files (download):
- Custom download
route - Download compatible with small and large files, including progressive (
chunked) download - Correct
mime-typeandContent-Rangeheaders - Correct
206and416responses - Following RFC 2616
- Control access to files
- Files CRC check (integrity check)
- Serve public files with a server like nginx
- Custom download
- Write to file system (
fs.):- Automatically writes files on FS and special Collection
path, collection name, schema, chunk size and naming function is under your control- Support for file subversions, like thumbnails, audio/video file formats, revisions, and etc.
- Store wherever you like:
- You may use
Meteor-Filesas temporary storage - After file is uploaded and stored on FS you able to
mvorcpits content, see 3rd-party storage integration examples
- You may use
- Subscribe on files (collections) you need
API:
FilesCollectionConstructor [Anywhere]- Template helper
fileURL[Client] - Generate downloadable link in a template - Initialize FilesCollection
FileCursorClass - Instance of this class is returned from.findOne()methodremoveAsync()- {Promise} - Remove document, resolves to number of removed records link()- {string} - Returns downloadable URL to Fileget(property)- {object|mix} - Returns current document as a plain objectfetchAsync()- {Promise<object[]>} - Resolves to current document as plain object in Arraywith()- {FileCursor} - Returns reactive version of current FileCursor- See all FileCursor methods
FilesCursorClass - Instance of this class is returned from.find()methodfetchAsync()- {Promise<object[]>} - Returns all matching document(s) as an ArraycountAsync()- {Promise} - Returns the number of documents that match a query removeAsync()- {Promise} - Removes all documents that match a query, resolves to a number of removed records forEachAsync(callback, context)- {undefined} - Callcallbackonce for each matching documenteachAsync()- {Promise<FileCursor[]>} - Resolves to Array ofFileCursormade for each document on current CursorobserveAsync(callbacks)- {Promise