Store pictures as files or in the database for a web app?

后端 未结 10 2017
孤城傲影
孤城傲影 2020-11-22 06:32

My question is fairly generic and I know there might not be an 100% answer to it. I\'m building an ASP .NET web solution that will include a lot of pictures and hopefully a

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 07:07

    Better to store files as files. Different databses handle Blob data differently, so if you have to migrate your back end you might get into trouble.

    When serving the impages an < img src= to a file that already exists on the server is likely to be quicker than making a temporary file from the database field and pointing the < img tag to that.

    I found this answer from googling your question and reading the comments at http://databases.aspfaq.com/database/should-i-store-images-in-the-database-or-the-filesystem.html

提交回复
热议问题