DEV Community

Discussion on: Uploading Files to MongoDB with GridFS and Multer Using NodeJS

Collapse
 
stevegroom profile image
Steve Groom • Edited

Hi,
thanks' for the blog post - its good to have a working example, however I want to take it a little further as I need to add file uploads to my own project and so must refactor your code to fit my app structure. Somewhere along the way I am missing some synchronisation. Upload triggers the file create and immediately shows the home page. If I press refresh the missing image is shown.

I think the error will be in my files.js /upload route - probably the next() is in the wrong place or the fact that I have an app.use nested inside my app.post...

I opened a Stack Overflow question and then saw I could perhaps ask here too :-)
stackoverflow.com/questions/628608...

My ‘fork’ of your repo is here: github.com/stevegroom/redogridfsst...

regards
Steve