This name, "\\myNetworkFolder\myFile.png", is not generally accessible from the Web application. This is the
UNC path name which might be accessible, in particular, through the Windows
sharing service executed by other hosts of the same LAN:
Path (computing) — Wikipedia, the free encyclopedia[
^].
But the server-side code is executed in the sandboxed environment which only allows access to the file system objects under the root directory set up for your site. This is done for serious security reasons.
If you really want to store images on a separate hosts, there are some (potentially heavier) alternatives. First of all, please see:
Connecting Web Sites to UNC Network Shares[
^].
Also, you can serve-up those images on another host through as standard FTP server or another HTTP server. The you can access the data by your Web application's server-side code:
FtpWebRequest Class (System.Net)[
^],
HttpWebRequest Class (System.Net)[
^],
WebRequest Class (System.Net)[
^].
But first of all, I would think about moving all these images to the location of your Web site. Why not
keeping it simple?
—SA