Reputation: 23
I have a PHP website developed with UserCake and PHPMyEdit and my data stored in MySQL. Now i want to have PDF file uploads too in a way that i can control access permissions for different users and also the solution must work for large number of files uploads.
I want to know that is storing PDF files in MySQL a good solution for my purposes?
if not what is the best and ready solution?
Thx,
Upvotes: 1
Views: 241
Reputation: 2125
Storing binaries on your database are usually not a very good idea.
Advantages of storing in the database:
Disadvantages of storing in the database:
It's usually faster to retrieve the file path from the database and stream the file directly to the user.
EDIT: I thought it through, and came up with two more advantages of storing on your database. Just editing to play devil's advocate, give you all the information and let you decide by yourself which approach is better for your case.
Upvotes: 3
Reputation: 1815
You can keep the relative path to the pdf in the database. This way, you can avoid all the overheads on DB.
If you are storing the PDF itself, that must be justified by very strong reasons.
Upvotes: 0