save a PDF file inside a mySQL table
View Single Post
07-11-2010, 09:54 PM
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
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.
View Public Profile
Send a private message to delayedinsanity
Visit delayedinsanity's homepage!
Find More Posts by delayedinsanity