ACCESSING REMOTE FILE IN ASP.NET

I have the following problem :
i want to copy an excel file from a remote server on my web server.
the network path is for example \\max71\excelmodels\file1.xls
From web server i see this directory.
when i run my application in asp.net i get the error could not find file \\max71\excelmodels\file1.xls.
I have read that this can be a security problem (but in other question i see error denied access for example).
in my web.config file i have already add identiy impersonate="true" but nothing change.
NUCLEAREAsked:
Who is Participating?
 
prajeebkumarCommented:
you said you have to enter a username/password to see the directory on \\max71 ...

can you try putting this line in web.config with that credentials and try.

<identity impersonate= "true" userName="User" password="password"/>
0
 
prajeebkumarCommented:
ok, first try mapping a network drive to \\max71\excelmodels...  just to make sure you can access that directory...

don't use impersonation, just give asp.net and IUSR_machinename user full (or read) permissions on the \\max71\excelmodels folder. now, when you give the file path to copy, use full UNC path \\max71\excelmodels\file1.xls..

i hope \\max71 has .net installed on it with IIS otherwise those users won't exist on max71.  if not, you may have to use impersonation with a specific account which has access to \\max71\excelmodels.
<identity impersonate= "true" userName="User" password="password"/>

when you try to map a network path with a user that doens't have the permissions, you might have noticed "path not found/directory doesn't exist" message..
0
 
NUCLEAREAuthor Commented:
hI,
i have give permission to my folder excelmodels to asp.net and iusr_machinename.
In remote server there is IIS and .net framework.
I my web.config file on web server i have delete identity impersonate.
From web server if i run \\max71\excelmodels i see the directory(note that i have to enter a password, perhaps
can be this the problem)
I get always the same error in my asp.net from web server.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.