jass
jass

Reputation: 297

Store files on mongodb database or server

I have a website built on MongoDB which has files to be downloaded by users other than images ( it can be a software installer or .exe file .msi file or .blender file ) I mean different file formats.

How can you store such files on the server so that users can download them? As an example software companies have their software on servers that we as users can download. How do they store the on server if they use MongoDB?

Upvotes: 2

Views: 1023

Answers (1)

R2D2
R2D2

Reputation: 10727

MongoDB is in general document store , and it is best practice to store just a link in mongoDB , but keep the file content in file system, ftp , sftp, s3 , cloud object storage etc. If you anyway want to store files in mongoDB you can still do it , but you are facing the default max document size limit of 16MB so you need to use the special file storage API -> gridFS to overcome this limit for files bigger than 16MB.

Upvotes: 2

Related Questions