-1

I am weak in coding so I am asking this type of question. I've read similar questions but could not find out the solution to my question.

All I want is to store the actual word or pdf file (and not links) in the MongoDB using NodeJs as backend and AngularJs as frontend.

I've read that GridFS is used for this but I could not figure out how!

Himanshu K
  • 224
  • 1
  • 6
  • 17

1 Answers1

0

Ok... Firstly you cannot save a file in MONGODB, only text. Thus what I do is save the path to the file. For example: src: "/uploads/pdfs/pdf1.pdf". Save the file in node JS using https://github.com/jacoborus/node-filesaver . Slim example of what I would do: http://pastebin.com/huvCknWb