save a PDF file inside a mySQL table
Hello dear colleagues,
I have been asked to test an application for Documentation Management, I am not sure on which language has been developped, but it was storing the data in a mySQL database on a Linux server.
Everytime I was saving a PDF/DOC,etc, I could see the size of the mySQL database growing up.So this application is storing these entire files inside a mySQL table.
Can anyone explain how this can be done from a php program, or how should the column be defined on the mySQL table.
Thanks in advance for all the help,
The short answer is don't do this. Binary files can be saved directly in the database, but there's never been a good reason to purposely bloat your database like this and slow down operations performed on the table.
Store them in the filesystem, which was built for storing files. A well built application shouldn't even need to store the path in the database, but at the very most this is all you should be storing (the path/location of the file associated with the table row).
If you want to play around with it for educational purposes however, the field type you're looking for is BLOB. Aptly named because this is what your database will do with a few hundred to thousand PDFs stored in it.
|All times are GMT. The time now is 05:26 PM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0