-
-
Notifications
You must be signed in to change notification settings - Fork 167
Home
dr.dimitru edited this page Jun 29, 2022
·
36 revisions
Explore documentation and examples for files' upload and its custom integration into Meteor.js application
Browse documentation directory or navigate using lost of links below.
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-type
andContent-Range
headers - Correct
206
and416
responses - 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-Files
as temporary storage - After file is uploaded and stored on FS you able to
mv
orcp
its content, see 3rd-party storage integration examples
- You may use
- Subscribe on files (collections) you need
-
FilesCollection
Constructor [Isomorphic] -
insert()
[Client] - Upload file(s) from client to server -
write()
[Server] - WriteBuffer
to FS and FilesCollection -
load()
[Server] - Write file to FS and FilesCollection from remote URL -
addFile()
[Server] - Add local file to FilesCollection from FS -
findOne()
[Isomorphic] - Find one file in FilesCollection; ReturnsFileCursor
-
find()
[Isomorphic] - Create cursor for FilesCollection; ReturnsFile__s__Cursor
-
remove()
[Isomorphic] - Remove files from FilesCollection and "unlink" (e.g. remove) from FS -
unlink()
[Server] - "Unlink" (e.g. remove) file from FS -
link()
[Isomorphic] - Generate downloadable link -
collection
[Isomorphic] -Meteor.Collection
instance -
Template helper
fileURL
[Client] - Generate downloadable link in a template - Initialize FilesCollection
-
FileCursor
Class - Instance of this class is returned from.findOne()
method-
remove(callback)
- {undefined} - Remove document -
link()
- {String} - Returns downloadable URL to File -
get(property)
- {Object|mix} - Returns current document as a plain Object -
fetch()
- {[Object]}- Returns current document as plain Object in Array -
with()
- {FileCursor} - Returns reactive version of current FileCursor
-
-
FilesCursor
Class - Instance of this class is returned from.find()
method-
fetch()
- {[Object]} - Returns all matching document(s) as an Array -
count()
- {Number} - Returns the number of documents that match a query -
remove(callback)
- {undefined} - Removes all documents that match a query -
forEach(callback, context)
- {undefined} - Callcallback
once for each matching document -
each()
- {[FileCursor]} - Returns an Array ofFileCursor
made for each document on current Cursor -
observe(callbacks)
- {Object} - Functions to call to deliver the result set as it changes -
observeChanges(callbacks)
- {Object} - Watch a query. Receive callbacks as the result set changes - See all methods
-
- Default Collection Schema
- Simplest upload app
- Simplest streaming app
- Simplest download button
- Fully-featured file sharing app — live: files.veliov.com
-
docs
Third-party storage (AWS S3, DropBox, GridFS and Google Storage) -
code-sample
File subversions - Create video file with preview and multiple formats -
code-sample repo
cURL/POST upload by @noris666 -
tutorial
MUP/Docker Persistent Storage - Deploy via MeteorUp to Docker container with persistentstoragePath
-
tutorial
React.js usage - React with a progress bar and component with links to view, re-name, and delete the files -
tutorial
Migrating from CollectionFS/CFS - Live conversion from the depreciated CFS to Meteor-Files (Amazon S3 specifically, but applies to all) -
tutorial
GettingFilesCollection
instance - Retrieve the FilesCollection by it's underlyingMongo.Collection
instance -
tutorial
Migrating / moving GridFS stored files - Three step way of moving/copying/syncing GridFS-stored files between multiple Meteor applications -
tutorial
GridFS streaming - Implement206
partial content response -
Post-processing:
-
tutorial
Create Thumbnails -
tutorial
Image post-processing using AWS Lambda -
code-sample
Resize, create thumbnail
-
-
pyfiles
(meteor-python-files) Python Client for Meteor-Files package -
meteor-autoform-file
- Upload and manage files with autoForm
Meteor-Files | Support | Try ostr.io |
---|---|---|
If you found this package useful, — star it at GitHub and support our open source contributions with a monthly pledge, or submit a one-time donation via PayPal | Monitoring, Analytics, WebSec, Web-CRON and Pre-rendering for a website |