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
1
vote
0 answers

Meteor how to create copy of file in CollectionFS?

I need to create copy one of record in my FS.Collection ... I am able to fetch record by var oldFile = Attachment.find({ _id : cardId }); var newFile = oldFile.copy(); Above code doesn't work for me I have following packages installed in my Meteor…
NewbieFreak
  • 325
  • 1
  • 4
  • 13
1
vote
1 answer

Is there any event listener/callback for file download in CollectionFS?

I'm using the CollectionFS to store and download files from my application Download And I want to execute a server-side function when the file is downloaded (without using jQuery because it's not really…
Adlen Gharbi
  • 214
  • 2
  • 11
1
vote
0 answers

meteor: how to upload whole folder using collectionFS?

im trying to upload folder to the server and keep the structure of the folder in the server using collectionFS and filesystem. Are there any ways to do this?
Meni Edri
  • 63
  • 1
  • 6
1
vote
1 answer

Meteor: Accounts._storedLoginToken is not a function

I am using CollectionFS with GridFS to upload images: Pictures.insert(e.target.files[0], function(err, res) { if (err) return console.log(err); this.setState({editing: false}); }); However when uploading I get an error: Exception in delivering…
Nicolaid
  • 65
  • 2
  • 6
1
vote
1 answer

Meteor reactive tables with FS.Collection

I'm struggling to implement reactive tables based on a FS.Collection object. I've tried both aldeed/meteor-tabular and aslagle/reactive-table but both fail because the collection doesn't appear to exist. However, if I subscribe and retrieve fields…
Achtel
  • 53
  • 6
1
vote
1 answer

Meteor how to set path of image folder in CollectionFS to special folder in project

I am trying to save uploaded images into public/images folder of my meteor project, so I wrote this code. Images = new FS.Collection("images", { stores: [new FS.Store.FileSystem("images", {path: "images"})] }); But when I upload images, the…
Samuel Jansson
  • 329
  • 1
  • 3
  • 13
1
vote
1 answer

CollectionFS 503 Service Unavailable

I need to upload 'on fly' user's image. But i get error 503 Service Unavailable. user.js Meteor.subscribe('userImages'); Template.userProfil.events({ 'change [name=userPhotoUpload]': function(event) { event.preventDefault(); …
Andrey Nadosha
  • 262
  • 1
  • 4
  • 16
1
vote
1 answer

Meteor CollectionFS - How can I modify my text file?

I have successfully uploaded a text file into a FS collection store. Now I want to modify the content of that text file or extract some information. I can get the file object with: var fileObj = myFSCollection.findOne({}); From what I have read,…
John McNeill
  • 143
  • 1
  • 12
1
vote
1 answer

CollectionFS get image dimensions before transformation

I would like to resize image upon upload with Meteor CollectionFS. But I would like to resize based on image dimensions. For example, I want to resize image that is 1000x500 into 1024x512, but 60x100 into 64x128 - for that I need to know source…
Martins Untals
  • 2,128
  • 2
  • 18
  • 31
1
vote
0 answers

MeteorJS unexpected behaviour when calling server methods

Some how sequence or delay on server calls brings different behaviour. Code should explain this more clearly. let editProfile = function (e) { e.preventDefault(); let info = {}; info.username = $(".editProfile #usernameInput").val(); …
1
vote
1 answer

Upload files in dynamic subfolders in Meteor CFS filesystem

I am using Meteor Local filesystem to upload my assets using FS.Store.FileSystem API in a specific folder. But, I want to upload those assets category wise in seperate folders based on their type metadata. I can't figure out how to do this in…
1
vote
1 answer

How to Upload an Image to Server on Meteor Startup

I am trying to Set a default DP for the users who do not have/not uploded an image. Tried using helpers to display content but getting error "Uncaught Error: {{#each}} currently only accepts arrays, cursors or falsey values." Code Below(Client…
1
vote
0 answers

Meteor Collectionfs, how to save all images

I want to save all my images in a imageStore, saving, uploading and so on works fine, just this "little" problem. With this code, i go through all images and want to save them. jQuery('img').each(function () { FS.Utility.eachFile(event,…
equalsound
  • 187
  • 1
  • 2
  • 15
1
vote
0 answers

How to upload file in android to meteor CollectionFS based web application

My meteor web app using CollectionFS. File uploading is normally for almost all kinds of browser, except for browser from android mobile phone. Below is a live demo of meteor CollectionFS (not mine): http://collectionfs.meteor.com Every file I…
Ryan
  • 800
  • 1
  • 13
  • 27
1
vote
0 answers

Meteor - Meteor-CollectionFS - Intercept file to be able to email it as well as save

I am using Meteor-CollectionFS to do a file upload of a pdf. It is storing it using S3 and this is all working. My question pertains to how can I intercept the file and convert it to a base64String so that I can use Mandrill to email a copy of this…
BobFranz
  • 250
  • 2
  • 15
1 2
3
8 9