What is the best way to store user uploaded files in a website?

后端 未结 2 1903
暖寄归人
暖寄归人 2021-02-14 14:38

I\'m trying to create a website in which I need to store a few user uploaded files (like some profile images, some xml files etc).

So what is the best way to store those

2条回答
  •  名媛妹妹
    2021-02-14 14:52

    Well you have a few options.

    1. You can store them as files on the file system, outside the web root.
    2. You can store them as binary data in a standard RMDBS like MySQL.
    3. You can use a "NoSQL" database like CouchDB or Redis which are specialized in storing documents.

    The best way will depend on your application, timeframe, and your experience. Option 1 would probably be the easiest. Option 2 would probably be the most flexible. Option 3 would likely be the best performing if it meets the needs of your documents.

提交回复
热议问题