I want users to be able to upload their CV in PDF, .txt, .doc, .docx; and allow potential employers to download the file.
What data type should I use? In MS MSQL, I would use varbinary(max), right? But since I'm new to MySQL I'm a bit confused. :)
I want users to be able to upload their CV in PDF, .txt, .doc, .docx; and allow potential employers to download the file.
What data type should I use? In MS MSQL, I would use varbinary(max), right? But since I'm new to MySQL I'm a bit confused. :)
You should use varchar holding a path to the file. File itself should not be stored in database.
Its usually a bad idea to store binary documents like DOC in MySQL. I would just upload them to the filesystem or convert to plaintext before saving to MySQL as BLOB or varchar.
I agree with most of them above. Is is generally not a good idea to store files in the database unlike Facebook which stores thumbnails in the database.
no one should mention the whole don't store files in a db to flickr. :)
Storing files, even large ones, in the DB is a question about your hardware more than a programming practice. if your server (or server farm) can handle the business there's no real disadvantage to it, and there are advantages. the principal one being that files in a db aren't "stuck" to the server. files go wherever the database goes, and are replicated as required.
as with everything, no one answer is correct.. you have to make your best decision based on your actual project requirements and future plans.