If you want to "serve them up" to a client browser, then at some point the
file has to be on the webserver.
So it depends.
If you ~can just store them on the webserver, then that's the easier option.
Or , you can "copy them on demand".
See my modified example below to start out.
So that gives you the ORIGINAL location of the files.
If someone requests the item (product in your case) that is represented by
the dad.jpg image... you can copy it on demand.
(File Copy) from
\\fileserver2\folderB\family\dad.jpg
To
( web server ) C:\inetpub\wwwroot\urlimages\
you'll have to figure out a way to have unique file names ... one way
change the filename (replace \ with _ )
fileserver2_folderB_family_dad.jpg
and you end up wiht the file:
C:\inetpub\wwwroot\urlimages\fileserver2_folderB_family_dad.jpg
That will end up being (as a web link)
http//
www.mysite.com/urlimages/fileserver2_folderB_family_dad.jpg
The reason you want a consistent file name is so you don't unnecessarily
copy images.
the logic is
rework the fileserver filename to the localfile name
see if the local filename exists
(C:\inetpub\wwwroot\urlimages\fileserver2_folderB_family_dad.jpg)
if it doesn't , copy it
if it does, just keep moving
rework the url so you can give the client a url that actually works (
http//
www.mysite.com/urlimages/fileserver2_folderB_family_dad.jpg )
And then you have to write a cleanup service that runs at night or
something.
It depends what your goals are.
The solution above is good for a webfarm, because you don't have to keep X
number of copies of images (per web server). And you don't fill up the
harddrive with images.
But it takes a little work.
And based on what you're saying, I'd go with the solution above.
I've done this exact same thing. My company has millions of images we have
to serve up internally (intranet), and we have huge fileservers to hold just
the images.
The "copy on demand" solution works well.
And I STRONGLY recommend the
inclusion. Because eventually you'll have to move images from one file
server to another. This way you update 1 or 2 records, not thousands (or
millions) of records doing string manipulation.
Good luck.
Read the other posts about the thumbnails also. I won't repeat that
information unnecessarily.