You are here: Storing PHP file uploads in MySQL database « All PHP « IT news, forums, messages
Storing PHP file uploads in MySQL database

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация