简体   繁体   中英

Where should I store user uploaded files nodejs mongodb

In my app I have a list of customers, and I want to be able to attach files to customers and for them to be saved on their profile. The files will be png, jpg or pdf.

I'm using vue, nodejs and mongodb. a few possible solutions I am considering:

  • Saving the files in a folder on the server - sounds unscalable. I don't want to lose control over the space in my server.
  • Storing the files as binary data in mongodb
  • Storing the files on AWS S3
  • Using a third-party service like Cloudinary

I'm wondering which is the best way. Regurding the last two, if anyone has any information about the pricing please share.

Would love to hear your thoughts on the matter.

Thanks in advance.

I think here we need more requirements, but if you are using other AWS services - the best way is to use S3 as file storage and save links in the database (MongoDB or whatever) for download.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM