Questions tagged [gridfs]

GridFS is a specification for storing large files in MongoDB. All of the mongodb.com supported drivers implement the GridFS spec.

GridFS is a specification for storing large files in MongoDB. MongoDB supports storing binary data directly within BSON documents, however the size is limited by the database's maximum document size (16MB as of the 1.8 production version of MongoDB; 4MB in older versions).

GridFS works by splitting large files into small "chunks", usually 256k in size.

GridFS uses two collections to store data:

  • chunks contains the binary segments of files
  • files contains metadata including the filename, content type, md5 checksum, and any optional information added by the developer

Each file saved in GridFS will have one document in the files collection and one or more documents in the chunks collection.

The GridFS collections also use a prefix (aka namespace). The default prefix is fs, so the default collection names are fs.chunks and fs.files.

GridFS collections are stored in normal MongoDB databases, and can be scaled with standard features such as replication and sharding.

Working with GridFS

All of the mongodb.org supported drivers implement the GridFS spec.

The command-line utility mongofiles can also be used to save, retrieve, list, search, and remove files in GridFS.

Related Links

1101 questions
0
votes
1 answer

MeteorJS - Linking images (FS.collection) to their relevant document in the MongoDB Collection

I'm building an app with Meteorjs. I have a collection that is initialized as: Places=new Mongo.Collection('places'); in which I also want to store the images of the corresponding place. I've added the collectionFS package to my project. The…
Saharcasm
  • 148
  • 1
  • 8
0
votes
0 answers

How to reload/resubscribe to show updated photo crop in Meteor

I have a photo page with a jquery cropper loaded on an image. When satisfied with the crop dimensions, the user clicks a button and a method is called to crop the image. 'update_crop': function( fileObj_id, photoSpec ) { …
0
votes
1 answer

CollectionFS get url from Client

I am developing my first meteor app, and have just implemented uploading images using CollectionFS and gridfs. I can successfully view my uploaded images using but I need to access it from the client in Meteor. I am trying…
Cam
  • 13
  • 3
0
votes
1 answer

Image uploading fails using html in bottle framework

I am creating a simple web application, where you can upload your article along with an image, using bottle framework. The HTML code for the upload page is:
Pranjal
  • 659
  • 1
  • 7
  • 24
0
votes
2 answers

How to overwrite DropzoneJS's XHR for GridFS?

I'm currently developping an image sharing plateform, using Meteor, CollectionFS and GridFS StorageAdapter. I'm also using the excellent package dbarrett:dropzonejs, but problem is its implementation for CollectionFS, especially regarding XHR and…
Sharlaan
  • 51
  • 9
0
votes
0 answers

Storing Small Files in MongoDB Document

From what I've read it is recommended to store anything under 16 MB in a document and anything above in GridFS. Okay fine. My question is what is the best way to do that? My application can process hundreds of files concurrently and the files can…
0
votes
0 answers

Accessing GridFS File on Server Side in Meteor

At this point I'm literally pulling my hair out at the lack of documentation. I'm simply trying to read a file uploaded to the server using GridFS. On the client side, it's as easy as going to http://app.url/cfs/files/collection/id. I already…
Matt Mancuso
  • 143
  • 1
  • 1
  • 9
0
votes
0 answers

Get GridFS files by tags stored in metadata

I have an web application that should store uploaded files with GridFSin a specified MongoDB. The files have several metadata. One is a Tags collection. To write the metadata for the file into MongoDB the code is like this: BsonDocument…
Simon Linder
  • 3,378
  • 4
  • 32
  • 49
0
votes
0 answers

multipart request does not work in spring rest service

I have no idea what mistake I am making while sending request to upload the file, please have a look and suggest. Multipart Filter Configuration in web.xml file multipartFilter
0
votes
1 answer

How to save a document with a file mongodb

I want to save a document(a person's information) in mongodb, with a pdf File uploaded and added in it(CV) which means each document is related with a file. There is GridFS, i found that files are stored in two specific collections: files and…
METTAIBI
  • 3,201
  • 5
  • 22
  • 29
0
votes
2 answers

Save a pdf file stored in Mongodb GridFS using Python

I had uploaded some PDF, PNG files to a local instance of mongodb. By mistake I deleted these files and I can no longer recover them using the regular recover options. However, they are in my local mongodb database. How can I save them back in their…
Curious2learn
  • 31,692
  • 43
  • 108
  • 125
0
votes
0 answers

GridFS upload file implementation details

Is it possible to allow UPLOAD-only role to user? Does GridFS perform update onto fs.files during upload? Does GridFS implementation perform any "update" or "read" action onto "fs.files" or "fs.chunks" collection during file upload?
dimzon
  • 414
  • 4
  • 13
0
votes
0 answers

Error while accessing multiple images from Mongodb GridFS using Nodejs: Can't set headers after they are sent

var newid = []; var newid = ["55dd605d636145b80f52b85e","55dd652b717d72200538cb72","55dd8f7bbc96c06808a245ae"]; for(var i = 0;i<=2;i++) { var fileId = mongoose.Types.ObjectId(newid[i]); var gridStore =…
Rapid
  • 111
  • 2
  • 13
0
votes
1 answer

gridfs-stream upload a file into mongodb not working in node.js server code

gridfs-stream upload a file not working, but download a file working plz give solution app.post('/file', function(req, res) { var busboy = new Busboy({ headers: req.headers }); var fileId = new mongo.ObjectID(); var file =…
0
votes
1 answer

How to search for a file using CFS:GridFS in meteorjs

I used GridFS Package to create a file upload system in meteorjs this is the Code var files = event.target.files; FS.Utility.eachFile(event, function(file) { Files.insert(file, function(err, fileObj) { //…
Fady Samir
  • 13
  • 4