Remote Files

  • Thread starter Thread starter Rui Silva
  • Start date Start date
R

Rui Silva

Hi everyone!!

I'm working on an web Application and in som ASPx pages i need to open files
that are in another pc in the intranet.
I'd like to, in runtime, make a copy of those files in my webserver. I've
tried the FileInfo and teh File objecto from the .Net Framework, but i
always get the FileNotFound exception.
I've noticed that if instead of trying to copy the files, create a link to
open them, there is no problem at all.
The problem is that i reall need to copy them, cause opening through
hyperlinks it's not possible cause of intranet security. i.e., some intranet
users can´t access to the pc where the files are.

Thaks for your help!!

Rui Silva
 
Hi Rui,

aspnet account under which aspnet applications are running is very
restricted.
You have at least two possibilites described below:

You might want to create a domain account, set your aspnet app to run with
its credentials and give the account enough privleges.
Or create a local account on both computers with same name/password on both
computers and do the same as above.
 
Hi Mika,

I've understood what you said and i know that the username that i use to log
on in the intranet has priviledges to access that pc.
My question is: How can i set the aspnet app to run with my username?

Thanks in advance,
 
Hi Rui,

That would be Miha (like Schumacher and not Mika like Hakkinen :) )
As per your question, make sure you read
"Access Permissions for Web Applications" and "
ASP.NET Process Identity" help topics of .NET help files.
You will have to modify machine.config file in your case.
 
Miha,

first of all, i'm sorry for misspelling your name. It won't appen again ;)

I've been reading what you told me, and trying some things.

By the way, the "Machine.config file" is what? the "web.config" on the
webservices?

Thanks on advance.
 
Hi Rui,
Rui Silva said:
Miha,

first of all, i'm sorry for misspelling your name. It won't appen again ;)

No problem :)
I've been reading what you told me, and trying some things.

By the way, the "Machine.config file" is what? the "web.config" on the
webservices?

Ah, there is an easier way just for one application. Just put a line into
web.config file somewhere under
<system.web> node:

<identity impersonate="true" userName="USER" password="PASSWORD"/>

Now, your app will run under given user account.
 
Back
Top