Re: Storing images in MySQL table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> The only disadvantage i've had of storing images in DB instead of
> Filesystem, is that when you use a PHP script to output the image to a
> client browser, MSIE doesn't always accept a suggested filename so it
> might try and save it as "your-script.php?img=2".
>
> Other then that, keeping images in DB is a lot easier since you don't
> have to keep your DB in sync with Filesystems ie. Deleted records in DB,
> but images still exist.

A way I've gotten around this, is that when I dump images into a directory
for use by articles in my db, the filename is always name
$articleid.filename (since articles and pics are uploaded to the server
via php, this is easy to enforce).

Thus, when I do kill of articles and what not, I simply remove
$articleid.* from my images directory as well.

I would strongly argue against stuffing images into a database tho.
That's what filesystems are for, and they are way better at it.  The
overhead alone is reason enough to make you decide against it.

--
At no time is freedom of speech more precious than when a man
hits his thumb with a hammer. -- Marshall Lumsden
Sumbry][ <sumbry@sumbry.com>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux