Posted by Taras_96 on 07/07/06 02:28
Hi all,
I'm trying to decide whether to store image uploads in a mysql
database, and the pros and cons I can think of this technique. The
images will not be used for any searching whatsoever.
PRO: you can't ever print out a file that wasn't uploaded (since all of
the files in the db were uploaded)
Don't have to ensure uniqueness of names (even though this isn't that
hard)
Less interaction with the file system (although I can't really think
why this is good, apart from maybe making the app a bit more secure)
CON: db overhead
extra coding complexity
Does anyone have any comments?
I've seen examples use both BLOB and TEXT fields on the PHP manual
website(the latter using base64 encoding to encode the data). Seeing
that this adds a storage overhead of about 33%, wouldn't it be better
to use mysql_real_escape_string to escape the data, and store it in a
BLOB type?
Thanks
Taras
[Back to original message]
|