What is the best way to associate a file with a piece of data?

前端 未结 8 950
别跟我提以往
别跟我提以往 2020-12-29 13:52

I have an application that creates records in a table (rocket science, I know). Users want to associate files (.doc, .xls, .pdf, etc...) to a single record in the table.

8条回答
  •  感情败类
    2020-12-29 14:25

    You should only store files in the database if you're reasonably sure you know that the sizes of those files aren't going to get out of hand.

    I use our database to store small banner images, which I always know what size they're going to be. Your database will store a pointer to the data inside a row and then plunk the data itself somewhere else, so it doesn't necessarily impact speed.

    If there are too many unknowns though, using the filesystem is the safer route.

提交回复
热议问题