So, I have two applications, one is Web and the other is a console app. The console app creates directories/folders and pdfs in a remote server. The web site (that is running in IIS) has a .aspx document that starts that console app. Running the console app does't give me problems, the problems come when I run the web site and fails to create the directories and pdfs. This is the error:
Error: Access to the path '\\SERVERIP\rae\RAE\' is denied.
That server has credentials and I am thinking that when I run just the console app it takes the credentials before typed (because to access the remote server I needed to type the credentials to see the folders in that server) but when I run the web site, the credentials are asked again (no prompt shown) and that's why the access is denied.
I am using C#'s System.IO.Directory.Exists(route);
to check if exists and if it doesn't System.IO.Directory.CreateDirectory(route);
Is there a way to set the credentials for that server in code, on IIS or with another method?
you can set the condition on web.config for specific folder only.