Questions tagged [gridfs-stream]

gridfs-stream is a node.js module that provides streams for writing to and reading from GridFS on MongoDB.

For more information, visit gridfs-stream's github repository.

160 questions
0
votes
1 answer

associating a GridFS-Stream file to a Schema with Mongoose

I am writing an API for my application, using Mongoose, Express, and GridFS-Stream. I have a Schema for the articles the user will create: var articleSchema = mongoose.Schema({ title:String, author:String, type: String, images:…
ZombiEquinox
  • 85
  • 2
  • 10
0
votes
0 answers

MEAN : Serve File from GridFs

I am using MEAN stack and I am trying to serve a file stored using Mongo GridFs. This is the code I have tried so far. exports.getFile = function(req, res) { var fileId = req.params.fileId; gfs.findOne({ _id: fileId }, function (err, file) { …
vinesh
  • 4,745
  • 6
  • 41
  • 45
0
votes
1 answer

Upload file using ng-file-upload and mongo gridfs

I want to upload a file that is more than 16MB to my database Mongo. On the front end part, I use ng-file-upload module (https://github.com/danialfarid/ng-file-upload). On the back-end side, i use connect-busboy and gridfs-stream modules I get the…
edevregille
  • 209
  • 2
  • 12
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

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

Trying to use fs.get function to get the chunks in mongoDB

I am trying to get the files that are stored in mongoDB with GridFS. I wrote this function to store the files into mongoDB using GridFS def write_file_object(file_name): with open(file_name) as mydoc: b = fs.put(mydoc,…
Qing Yong
  • 127
  • 3
  • 15
0
votes
1 answer

Download of GridFs using nodejs does not start

I'm trying to download a binary file of +200M saved in a mongoDB using the GridFS. My problem is that the download won't start. I'm using nodejs with mongodb and gridfs-stream. In routes.js: router.get('/getlog',function(req,res) { if…
cauchi
  • 1,463
  • 2
  • 17
  • 45
0
votes
1 answer

Serve files in img src using HTTP.get

My file can only be served if I add an x-authentication token to the header of the "GET" http request (and I don't want to use a cookie). The direct consequence is that I can not call for a file just by using its URL in the html, I need to get it…
0
votes
1 answer

insert video(bytes) sent from device in gridfs in mongodb node.js

I am new to gridfs mongodb and creating a POST service to recieve the bytes(of video) and want to save the bytes in mongodb. I have studied gridfs, but couldn't got the clear picture. I have written the code, but I don't know if it is good enough to…
JN_newbie
  • 5,492
  • 14
  • 59
  • 97
0
votes
1 answer

gridfs-stream createReadStream not returning readable data

I am using simple code below to retrieve a file stored in mongodb. The file is downloaded but not in PDF format. While writing the file, I have set the content_type in grid-fs api to application/pdf and I see the file is there in Mongo. The file…
honitus
  • 1
  • 2
0
votes
1 answer

stored files directly in mongodb with gridfs-stream

I need save some files like: images,video,pdf... into mongodb, so i use gridfs-stream and express.js var file = req.files.file; req.pipe(gfs.createWriteStream({ filename:file.originalname, mode:"w", chunkSize:1024*4, …
Maxtermax
  • 145
  • 2
  • 12
0
votes
1 answer

angular fullstack generator can not send iamge stored in mongodb

What a want to achieve is simple. I am using angular fullstack generator to produce the skeleton. User should be able to upload a profile picture along with their name, email etc. I am using angular-file-uplpoad to send the multipart form request.…
Qi Tang
  • 1,165
  • 6
  • 17
0
votes
1 answer

Very new to express and mongodb with gridfs-stream

and thanks in advance for any help you guys can give me. I am trying to use mongodb, mongoose, gridfs-strea, and express to store img files on mongodb. I do not want to store the file in a folder. I want gfs.createWriteStream to take the file…
jsrosas
  • 103
  • 2
  • 14
0
votes
1 answer

Gridfs cannot find file in different buckets

I have added a file into the collection my_collections. I am not able check if the file was saved. With the default bucket (fs.chunk and fs.files) the code below works properly db.my_collection.files.find() { "_id" :…
AmeyChavan
  • 362
  • 1
  • 2
  • 14
1 2 3
10
11