Without knowing what you really are trying to accomplish...

I've had very good results with the following bit of code:

                //scan the directory and load its contents into an array
                while (false !== ($file = readdir($handle)))
                        $retVal[] = $file;

                //close the directory read operation then sort the array

I use this code to look in any directory whose path gets passed to this set
of code. Once the filenames of the contents of the target directory are in
the array, you can pretty much manipulate them however you want. Personally,
I have a simple script that throws down an HTML table of only the thumbnails
in the directory and embeds links to the full size image. Nothing fancy.

None of the images or paths are ever stored in a database. It might help you
out a bit since the path to the images is passed as a variable with error
handling for missing directories. If you can either come up with a slick way
of grabbing the path to the image directory dynamically or wrapping up your
application code in the PHP equivalent of a Java .war file (I don't know
what that would be, by the way) for distribution then you might be able to
solve your problem all the way around.

This alone probably won't solve your problem, but it might give you
something to go on.


-----Original Message-----
From: Andy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 02, 2002 7:42 AM
Subject: [PHP-DB] storing content data outside the application

Hi there,

I have a problem with content data. Currently I do store images inside a
data folder.

This is causing a problem, because everytime I installan update of the
application on the server I have to move this folder around to the new
version of my application. I am worried that during this coppy an error will
apear, due to my fault, or whatever might happen. The immages are part of a
dataset stored in a mysqldb. So I tryed to store them to blobs, but this is
causing performance problems. Images apear much quicker while comming from
the filesystem. They also seem not to be cached by the client anymore.

Does anybody know a good method to store the images outside the rootfolder
and still access them the old fashion way?

Any suggestions are appreciated.

Thanx, Andy

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

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

Reply via email to