> I have an application that needs to be able to upload documents that can
latter be accessed and opened by a hyperlink. I can do this easliy if I
store the files in a subdirectory in the application, but we will be using
multiple web servers, so the files need to be stored on a common file server.
Saving them is easy enough, but how do I point a hyperlink at a file on a
file server that is different from the web server?
You probably need to make a page in the application which just
retrieves the content of a specified file, and writes it to the
Response stream [using BinaryWrite or similar]. Then, you would make
your hyperlinks point to this page and pass the name of the required
file in the request string.
For permissions, it depends on your accounts setup. If the files will
be saved/retrieved when the page is accessed anonymously, then you'd
need to give the account under which ASP.NET is running (probably the
IIS default anonymous user account, IUSR_<something >) read/write
permissions on the relevant folders; if they are on a different
machine, then you'd either need to make the ASP service run under a
domain account (so the file servers have access to the credentials) or
explicitly allow the local account on the web server access to the
files on the other servers (which might or might not be possible). If
you pages use an authentication scheme whereby they are running under
the context of the domain account of the user accessing the site, then
if those users have permissions to access the file server anyway, it
should 'just work'. If they do not, you could either grant them
permission, or make the relevant section of code run under an
impersonation context for a domain account that is permission to view
the files.
HTH
-- ph