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

why cant i delete gfs.files with an ObjectId?

This has been getting me all day. I can find the actual file with it's _id using gfs.exist(), but then when i run to the next line of code i get an error everytime and the mongoose connection crashes. This seems so simple yet nothing has worked so…
Chris Wilson
  • 135
  • 3
  • 16
1
vote
1 answer

how to return the result of mongoDB query and gridFS data in a one go?

I am using mongoDB and Codeigniter PHP framework in my project. i am dealing with an E-commerce website. i am using mongoDB to store product features and images of the products. product details are stored in a collection and their images are stored…
Telen Stanley
  • 310
  • 1
  • 6
  • 16
1
vote
1 answer

Meteor cfs:graphicsmagick transformWrite Error write eof at errnoException

Please help with this error, use cfs:graphicsmagick for Fs.Store.GridFS, I have this code.. Avatar = new FS.Collection("avatar", { stores: [new FS.Store.GridFS("avatar", { transformWrite: function (fileObj, readStream, writeStream) { …
1
vote
0 answers

Cannot read property 'ObjectId' of undefined at Stream.GridWriteStream

I am getting this error - Cannot read property 'ObjectId' of undefined at Stream.GridWriteStream at gfs.createWriteStream. Funny things is my implementation was working fine till yesterday. I cannot figure out what went wrong. var Grid =…
shiv
  • 383
  • 1
  • 4
  • 17
1
vote
1 answer

Initialization of db connection - nodejs

I want to use gridfs-stream in a nodejs application. A simple example is given in the documentation: var mongoose = require('mongoose'); var Grid = require('gridfs-stream'); Grid.mongo =…
Stefan
  • 1,041
  • 1
  • 14
  • 28
1
vote
0 answers

Simple video upload system w/ gridfs-stream works with direct iOS recording, but not when choosing a video from the phone's gallery

I'm trying to build a very basic video uploading system with gridfs-stream. It does work on desktop, but only partially on my phone (iOS9 iphone 5, using Chrome browser). It works perfectly using the direct recording iOS feature (recording a video…
TomB
  • 11
  • 3
1
vote
2 answers

Stuck at changing binary data to base64 (Gridfs-stream)

I am trying to change some binary data from my uploaded images to base64 so I can use that to display an image. But the terimal is giving me this error: TypeError: Cannot read property 'on' of undefined I don't understand, when I post I also use…
Murderlon
  • 11
  • 1
  • 4
1
vote
0 answers

Populate personal collection 'Articles' with GridFS - fs.files

I want to store files in MongoDB using GridFS for different purposes like streaming videos and saving images. This ones are part of one mongoose document "Article". Im thinking on using different buckets from GridFS for each file type "videos" and…
1
vote
2 answers

Encoding Issue with Gridfs-stream, Multiparty Middleware

I am having some problems properly storing and retrieving files with GridFS. Currently, if I submit a .txt file I end up getting the contents of the file back, but if i submit a .doc file, I get a bunch of gibberish (like blackdiamonds with…
Dave M
  • 418
  • 3
  • 15
1
vote
3 answers

using gridfs-stream write string to gridfs

I came acorss snippet to write file to gridfs, but I am unable to find write way to update string to Gridfs. the below snippet will update using path, but what about direct string buffer? var metadata = { "path": path }; var writestream =…
procoder
  • 31
  • 1
  • 7
1
vote
1 answer

Retrieve image from mongoDB

I am using gridfs, so I have in my monDB: fs.chunks: { "_id" : ObjectId("542e684a8a1cec178a172673"), "n" : 1, "data" :…
Carlos
  • 79
  • 1
  • 4
  • 16
1
vote
0 answers

How do I get the file id back from gridform?

For reference you can check the issue I submitted on GitHub. I am able to stream to MongoDB and the file is persisted and accessible, but the README shows during the parsing you can access the file id. This is required if you want to log or enqueue…
TonsOfFun111
  • 146
  • 5
1
vote
1 answer

File download is not working with nodejs gridfs

i'm uploading images to gridfs-stream using node and express..uploading is working fine but am unable to download app.post('/upload', function (req, res) { var tempfile = req.files.displayImage.path; var origname =…
user3279499
  • 35
  • 1
  • 6
0
votes
1 answer

Can't fetch files from mongoDB using gridFS

const mongoURI = process.env.MONGOURL; const connection = await mongoose.createConnection(mongoURI); connection.once('open', () => { var gfs = Grid(conn.db, mongoose.mongo); gfs.collection('uploads'); }) app.get('/files', (req, res) => { var…
0
votes
0 answers

Issue when uploading audio data with GridFS in a Next.JS app

I am working on a Next.JS web app making voice recording and uploading the produced audio data to a mongo DB using GridFS. Though it is basically working, the audio data being uploaded. I still get an error and the app crashes after the first…
Michel
  • 10,303
  • 17
  • 82
  • 179