You are here: Re: Is it better to save upload photo on the hard drive or in the database? « PHP SQL « IT news, forums, messages
Re: Is it better to save upload photo on the hard drive or in the database?

Posted by Stefan Rybacki on 10/14/05 22:01

NC wrote:
> Nicholas wrote:
>
>>I wondered what the best solution is: save uploaded photos as "BLOBs" in the
>>database itself (in my case MySQL) so that, except for the tmp folder, I
>>don't have to give write access, or on the hard drive to make it easy on the
>>database server?
>>
>>Seems to me that it's cleaner to save photos in the database itself.
>
>
> There is a tradeoff here. If you save images in the database, back-up
> and other maintemence tasks will be greatly simplified. However, if
> you do that, the performance of your application may suffer. To
> retrieve
> an image from the database, you need a separate script with a separate
> connection. So if you have a page with five images on it, an attempt
> to
> view that page will initiate six simultaneous connections to the
> database,
> one from the script itself, and five more from image display scripts...
>

Not at all. Get all images from the database with one query and store them in a session or
something similar and load it from their.

Anyway I don't like to save picture in the database.

Regards
Stefan

>
> One of these days, when all browsers start understanding <img
> src="data:*">
> tag, this may become moot point, but so far we are not quite there...
>
> Cheers,
> NC
>

 

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

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