Questions tagged [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 browser File object (and can be created from a File object), but it has additional properties and methods. Many of its methods are reactive when the instance is returned by a call to find or findOne.
  • An FS.Collection provides a collection in which information about files can be stored. It is backed by an underlying normal Mongo.Collection instance. Most collection methods, such as find and insert are available on the FS.Collection instance. If you need to call other collection methods such as _ensureIndex, you can call them directly on the underlying Mongo.Collection instance available through myFSCollection.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.

130 questions
0
votes
1 answer

Meteor / CollectionFS removes frontend collection contents upon download link click trigger

I'm using Meteor and CollectionFS with S3 to serve both thumbnails and full-size images from the same collection, using different stores. I want to download the full-size image upon a 'dblclick' event. var src = fileRecord.url({ store: 'images', …
Hunter Beast
  • 782
  • 7
  • 17
0
votes
0 answers

Meteor CollectionFS: userId param for Download allow/deny function

This problem is documented in the issue here but has not got a response yet. The documentation says that the the download allow/deny permission function gets the userId and fileObj but when I tried this, the userId is just a value…
Ayrton Senna
  • 3,735
  • 5
  • 34
  • 52
0
votes
2 answers

CollectionFS S3 ERROR STREAM images Access Denied

I'm trying to set up CollectionFS and S3 so that I can upload files to S3 from AutoForm. I have an Images FS.Collection defined with a .allow function living on the server, like so: // Client and server. var imageStore = new FS.Store.S3('images', { …
Patrick Coffey
  • 1,073
  • 8
  • 13
0
votes
2 answers

Meteor: How to save files with 'submit form' instead of 'change' events

I am trying to submit an image.. and I've been at this for the past two days. It seems like it's super simple but I can't get it the way I want it to. In the examples for collectionFS (and every other example I can find), they use an event that's…
socialight
  • 487
  • 1
  • 5
  • 18
0
votes
1 answer

How to get location/url of image from CollectionFS (Meteor)

I am trying to get the file location/url from a image I have just inserted. I have tried to use the path + objectID but the image is not present. I am trying to store the image url in another collection. So I can load that collection into my…
tomwassing
  • 925
  • 1
  • 10
  • 30
0
votes
1 answer

CollectionFS: insert image generated server-side

How do I generate a new image on the server and insert it into a collection [using Meteor/CollectionFS + GridFS]? The wiki explains how to insert from a stream on the server var readStream = spawn('ls', []).stdout; var newFile = new…
aleroy
  • 45
  • 6
0
votes
0 answers

Meteor allow deny not working in collection fs context

Meteor version 1.0.4 I removed autopublish and insecure Allow and deny work fine for Collections but not for FS.Collection I have this FS collection: Avatars = new FS.Collection("avatars", {stores: [new FS.Store.FileSystem("avatars", {path:…
0
votes
2 answers

How to retrieve single image URL from Meteor CollectionFS?

I need to retrieve an URL to an image from CollectionFS. Image IDs are referenced in posts so first off I find find an Image that belongs to a certain post like this: Template: {{#each drafts}} meteor
Kristis
  • 389
  • 3
  • 16
0
votes
2 answers

Show Image after Image has been uploaded using CollectionFS

Images are uploaded to AWS S3 using Meteor.js and CollectionFS. The image to be uploaded is selected via a file input field. 'change .upload-input': function() { Images.insert(imageFile, function(err, fileObj) { Albums.update({_id:…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
-1
votes
1 answer

meteor collection fs forbid upload

i want to forbid the upload / storage of files under special circumstances. I tried in the collectionfs before hook: Attachments.files.before.insert((userId, doc) => { if(!Meteor.isServer){ if (!isUploadAllowed()) { throw new…
Gobliins
  • 3,848
  • 16
  • 67
  • 122
1 2 3
8
9