Saving file to network location
-
25-10-2019 - |
Question
I have an application that has to save an uploaded file to 2 different servers for load balancing purpose. The first server (serv01
) is the same server as the application that I'm building, so no problem. But when the code execute the upload process to the second server (serv02
) using the following path;
\\serv02\path\path\
I get this exception "Logon failure: unknown user name or bad password.".
I suppose I have to add permission to asp.net user on the serv01
to this network location, but how? If I tried to add permission, it always asks users from serv02
. Is there anyone who can help me with this?
Thanks
Solution
Are you running in a workgroup or a domain?
If a workgroup then setup the same account that your using for your AppPool account on both servers (matching username & password) so that workgroup networking will work.
If it's a domain it should just be a case of configuring your AppPool to use a domain user account that has permissions to write to the share on each server.