Yes, this is certainly possible. I have no idea specifically how
stock phote sites do it, but I can think of lots of ways to do it.
There will be some trade-offs between simplicity and speed. Leaving
aside secure network design, something like the following would work,
and should perform reasonably well without being too complicated:
1) have a mysqldb on the webserver that will store photo
metrics,including the location, and thubmnails.
2) write a program that will periodically crawl the mapped network
drives for pictures. It get the details and thumbnails and stores
them in the mysqldb. It can be a simple batch script that is run
every 5 minutes by windows scheduler or cron. Essentially a very less
sophisticated version of the google desktop crawler.
3) Your php site will access the mysql db to present the basic info
the user. If the user chooses to download the photo, your php can
copy the photo from wherever the mysql says it is to the webserver and
send it to the user (or stick it in the webpage)
4) write another script that will periodically clean whatever
directory you copy the large photos to in step 3
This is a very naive way to do it, but unless you are looking for an
industrial strength solution, i think it would work ok. It would work
better with a app server to cache the picture info and field requests
rather than just a crawler, and I would not store everything on some
world accessible webserver. You want to have some kind of
demilitarized zone between your webserver and your network. But if
its that serious of a project, you are best off hiring some profession
developers. |