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.

128 questions
13
votes
1 answer

How to reference another collection on insert?

I'm trying to figure how to take an Image (a file using CollectionFS) and insert the Image's Id into my Items imageId field: lib/collections/items.js Items = new Mongo.Collection("items"); Items.attachSchema(new SimpleSchema({ name: { type:…
John Huntington
  • 397
  • 3
  • 16
12
votes
1 answer

How can I get a buffer for a file (image) from CollectionFS

I'm trying to insert an image into a pdf I'm creating server-side with PDFkit. I'm using cfs:dropbox to store my files. Before when I was using cvs:filesystem, it was easy to add the images to my pdf's cause they were right there. Now that…
Jared Martin
  • 593
  • 5
  • 20
7
votes
1 answer

Meteor CollectionFS:S3 GraphicsMagick Does Not Resize Image

I'm using Meteor-CollectionFS and GraphicsMagick 1.3.22 to resize an image uploaded to Amazon S3. The image does not resize, it just appears in S3 full-sized. I also tried putting the resized images in a seperate store, but the image still appeared…
7
votes
1 answer

Meteor.JS CollectionFS Video to Image Thumbnails (Graphics Magick)

I am working on one Meteor App where I am using CollectionFS to upload Files. I am able to upload and generate thumbnails for Images. But my Issue is : How should I create thumbnails for Videos? I can see that it is possible via command line:…
Manu
  • 181
  • 1
  • 8
6
votes
2 answers

gm: resize image if it is wider than 1000px

I am trying to do some image manipulation via gm in collectionFS, because I need to read a stream and write it back to the same file, I have to use a temp-file - like shown below. I want to check if the image is wider than 1000px. In this case it…
user3142695
  • 11,619
  • 29
  • 119
  • 238
5
votes
0 answers
5
votes
1 answer

Meteor CollectionFS - Image uploading on server

I am using Meteor CollectionFS. Currently my file uploading is performed on client. I want to perform file uploading on server so that other platforms like andriod or ios can use my services of file uploading. Currently here is my…
StormTrooper
  • 1,741
  • 4
  • 19
  • 26
5
votes
1 answer

Unexpected empty writestream in collectionFS using graphicsmagick

I'm using CollectionFS for managing images. Furthermore I'm using graphicsmagick gm() for manipulating images. Now I want to crop a already saved image. Therefore on a click event a server-method is called, which does the crop(). But after doing…
user3142695
  • 11,619
  • 29
  • 119
  • 238
4
votes
2 answers

Can't access uploaded images - Meteor GridFS

I am trying to make an upload images feature on Meteor using GridFS and everything seems to work but I cannot access the files. I am not sure they were successfully uploaded, but Images and EntriesImages collections are successfully populated with…
Skkyp
  • 253
  • 3
  • 9
3
votes
2 answers

graphicsmagick and cfs: Store one cropped image to three stores - creating temp stream

I'm trying to do some cropping using graphicsmagick and cfs and save the result to S3 (cfs:gridfs, cfs:graphicsmagick and cfs:s3). The cropped image should be stored to three stores (main, public and thumbnail) - the stores itself have some…
user3142695
  • 11,619
  • 29
  • 119
  • 238
3
votes
0 answers

Meteor CollectionFS: Using multiple stores for same collection leads to error

I'm using CfS for uploading some images to Amazon S3. Therefore I've got two stores: The original file and the thumbnail. For the original file I'm adding the dimensions of the image and the thumbnail is resized to a squared 96px image. This is…
user3142695
  • 11,619
  • 29
  • 119
  • 238
3
votes
1 answer

How to save a file -in a folder- using FileSystem and CollectionFS ? (yeah, really.)

I think I'm missing something. I have read a lot of posts/examples and I can't save images on my system (I work locally). What is my goal ? I'm trying to save a file submitted by the user in a folder (server-side). Does it sound easy ?…
Armelias
  • 249
  • 2
  • 5
  • 15
3
votes
0 answers

Meteor - collectionfs fileinput "DataMan constructor received data that it doesn't support"?

I am trying to enter a file into my DB that has user info attached to it. I keep getting a DataMan error and not sure how to work around. "DataMan constructor received data that it doesn't support" Here is the code I am working with 'change…
Aaron
  • 131
  • 6
3
votes
1 answer

Meteor file upload with Meteor-CollectionFS giving error method not found

I am using following meteor package to upload the image https://github.com/CollectionFS/Meteor-CollectionFS Code I am using Uploads =new FS.Collection('uploads',{ stores: [new FS.Store.FileSystem('uploads',{path:'~/projectUploads'})] }); if…
3
votes
2 answers

How can I query an FS collection in Meteor from the command line?

It is very useful to run meteor mongo and query collections from the command line, for debugging purposes, etc. Recently, I have added the collectionFS package to enable image storage in the database. However, I am unable to query the database from…
forallepsilon
  • 429
  • 2
  • 15
1
2 3
8 9