Acces files on remote server - problem

G

Guest

Hi,

on a fileserver I have several images en xml-files that I need to access.
In web.config I have this section
<appSettings>
<add Key="Remote" value="//000.000.000.000" />
</appSettings>


In my codebehind, there is this code
strRemote = ConfigurationManager.AppSettings["Remote"];


Without any problem I can browse, consult, read and open all files on my
remote server. But I cannot write to it. So no files can be updated...


this is the error I get
"unauthorizedaccesException"
"Access to the path '\\000.000.000.000\myFile.xml' is denied."

Yet I have added the correct rights to the server(ASP.NET machine account,
Guest Account for Internet acces - IUSR_myPc)
So there should be something else
but what

anyone?
 
P

Patrice

Is this is an existing file (in particular accessed before you try to
overwrite it ?). If yes try to see if creating a brand new file would work
(file used by IIS are AFAIK locked for a short period of time after their
use i.e. you might not be able to delete a file you just have displayed
through the web site)...

Double check also under which identity your web app is running to make sure
(are you using just anonymous authentication ?, also the default account is
not the same under IIS5/IIS6)...

Good luck.

--
Patrice

benoit said:
Yes I did..
I think i checked every possible access posibility and gave a lot of
rights
strange thing is that if i try this on my local machine, by using the IP
of
my computer it wil not work, but if I use "C:\mapping", then there is no
problem


Patrice said:
There is also a permission on the share itself... Have you checked this
one
?

--
Patrice

"benoit" <[email protected]> a écrit dans le message de
(e-mail address removed)...
Hi,

on a fileserver I have several images en xml-files that I need to
access.
In web.config I have this section
<appSettings>
<add Key="Remote" value="//000.000.000.000" />
</appSettings>


In my codebehind, there is this code
strRemote = ConfigurationManager.AppSettings["Remote"];


Without any problem I can browse, consult, read and open all files on
my
remote server. But I cannot write to it. So no files can be updated...


this is the error I get
"unauthorizedaccesException"
"Access to the path '\\000.000.000.000\myFile.xml' is denied."

Yet I have added the correct rights to the server(ASP.NET machine
account,
Guest Account for Internet acces - IUSR_myPc)
So there should be something else
but what

anyone?
 
J

Jason Kester

Yeah, the builtin ASPNET account won't have access to anything out on
your network. If you want to access remote files, you'll need to put
an Identity Imersonate tag into your web.config, and run the whole
application as a specified user. It's not a very elegant solution, and
often causes as many headaches as it solves (such as encouraging you to
put the username/password in cleartext in the web.config), but MS still
hasn't offered a way around it. It's been a problem from day one.

Good luck!

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top