I have two servers. Application server and File server. I need to upload files directly to File server.so far what i have done is, when i upload i received "unknown user name and bad password error" .so i created an user name and password in file server like in the Application server (IUSR_ account. exact like in the application server). Now i receive "System.UnauthorizedAccessException: Access to the path \xxx\xx... is denied".Then i granted the network service user as full permission in File server shared folder. still i get the UnauthorizedAccessException. And one more, the application pool is running under the identity of network user. Help needed. Thanks in advance...
-
Probably becuase the Network service user is running under the server workgroup. Set up a user on the mapped drive server and on the IIS server with the same name and password on bothOskar Kjellin– Oskar Kjellin2011-05-09 10:43:05 +00:00Commented May 9, 2011 at 10:43
-
that is what i did it in both servers. After that only i got UnauthorizedAccessException.Bala– Bala2011-05-09 10:44:42 +00:00Commented May 9, 2011 at 10:44
-
1Then why is the app pool running as network user and not the other one?Oskar Kjellin– Oskar Kjellin2011-05-09 10:46:43 +00:00Commented May 9, 2011 at 10:46
-
I changed to the user what i run under IUSR account. But the site went down.then i reverted back. Its production site...Bala– Bala2011-05-09 10:59:05 +00:00Commented May 9, 2011 at 10:59
-
1You will have to run the app service as a custom user as the network service account does not have equal passwords on both servers and thus will not be authenticated. Don't change this passwordOskar Kjellin– Oskar Kjellin2011-05-09 14:00:58 +00:00Commented May 9, 2011 at 14:00
1 Answer
Are the machines part of the same domain? In that case you give the machine account (called machinename$) of the app server access to the file server. Then you run the app server app pool under the "network service" account. You also have to access the file server with a complete unc path (\\server\share\directory) as mapped drives are tied to a specific user.
If you're not in a domain environment you need to add code so that the app server logs on to the file server when attaching the network share. Having the same username/password pair on both the client and server is something that works magically when logging on interactively, but for services that is not an option.