PC Review


Reply
Thread Tools Rate Thread

ASP.NET Accessing shares

 
 
=?Utf-8?B?T2xpdmVy?=
Guest
Posts: n/a
 
      9th Sep 2005
Hi,

I'm working on an ASP.NET application that allows users to upload images to
a central storage area and view using a HTTP handler.

This works great if the files are stored on a local drive on the web server.
The problem I have is that when I move this storage area to a share on
another machine with full permissions for everyone I still get
System.IO.FileNotFoundException.

Are there any other additional other permissions for the ASPNET account on
the web server that need to be set before I can access remote shares?

Many thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=
Guest
Posts: n/a
 
      9th Sep 2005
Hi,

have you try to add the ASPNET group to your share folder permission ?

"Oliver" wrote:

> Hi,
>
> I'm working on an ASP.NET application that allows users to upload images to
> a central storage area and view using a HTTP handler.
>
> This works great if the files are stored on a local drive on the web server.
> The problem I have is that when I move this storage area to a share on
> another machine with full permissions for everyone I still get
> System.IO.FileNotFoundException.
>
> Are there any other additional other permissions for the ASPNET account on
> the web server that need to be set before I can access remote shares?
>
> Many thanks

 
Reply With Quote
 
flipdoubt
Guest
Posts: n/a
 
      9th Sep 2005
Hello serge,

> Hi,
>
> have you try to add the ASPNET group to your share folder permission ?
>


I have, and it still doesn't work. I'm trying the solution presented at http://www.15seconds.com/issue/030926.htm


 
Reply With Quote
 
=?Utf-8?B?T2xpdmVy?=
Guest
Posts: n/a
 
      9th Sep 2005
Serge,

The machines are not part of a domain so the ASPNET account is only on the
web server and therefore I cannot give permissions to the user directly on
the share.

Going to read article posted by flipdoubt.

Thanks


"serge calderara" wrote:

> Hi,
>
> have you try to add the ASPNET group to your share folder permission ?
>

 
Reply With Quote
 
JIMCO Software
Guest
Posts: n/a
 
      9th Sep 2005
Oliver wrote:
> Hi,
>
> I'm working on an ASP.NET application that allows users to upload
> images to a central storage area and view using a HTTP handler.
>
> This works great if the files are stored on a local drive on the web
> server. The problem I have is that when I move this storage area to a
> share on another machine with full permissions for everyone I still
> get System.IO.FileNotFoundException.
>
> Are there any other additional other permissions for the ASPNET
> account on the web server that need to be set before I can access
> remote shares?
>


In a scenario like this, you should use P/Invoke to do code-level
impersonation. You can then impersonate a user (or group) who has access to
that share.

http://support.microsoft.com/default...B;EN-US;306158

See "Impersonate a specific user in code".

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003




 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      9th Sep 2005
First, the FileNotFoundException doesn't indicate a problem with
permissions. It means that the file cannot be found. In other words, your
path is wrong.

The best way to access a network share is to use a UNC path (e.g.
\\192.168.1.1\c$\somefolder\somefile.txt).

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Oliver" <(E-Mail Removed)> wrote in message
news:79A90A01-F0A8-4188-9578-(E-Mail Removed)...
> Hi,
>
> I'm working on an ASP.NET application that allows users to upload images
> to
> a central storage area and view using a HTTP handler.
>
> This works great if the files are stored on a local drive on the web
> server.
> The problem I have is that when I move this storage area to a share on
> another machine with full permissions for everyone I still get
> System.IO.FileNotFoundException.
>
> Are there any other additional other permissions for the ASPNET account on
> the web server that need to be set before I can access remote shares?
>
> Many thanks



 
Reply With Quote
 
JIMCO Software
Guest
Posts: n/a
 
      9th Sep 2005
Kevin Spencer wrote:
> First, the FileNotFoundException doesn't indicate a problem with
> permissions. It means that the file cannot be found. In other words,
> your path is wrong.
>


It is possible to see a FileNotFoundException when you are experiencing
permissions problems.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003




 
Reply With Quote
 
=?Utf-8?B?T2xpdmVy?=
Guest
Posts: n/a
 
      9th Sep 2005
I agree, I can open the file by pasting the UNC into explorer no problem -
just not through ASP.NET

"JIMCO Software" wrote:

> Kevin Spencer wrote:
> > First, the FileNotFoundException doesn't indicate a problem with
> > permissions. It means that the file cannot be found. In other words,
> > your path is wrong.
> >

>
> It is possible to see a FileNotFoundException when you are experiencing
> permissions problems.
>
> --
> Jim Cheshire
> JIMCO Software
> http://www.jimcosoftware.com
>
> FrontPage add-ins for FrontPage 2000 - 2003
>
>
>
>
>

 
Reply With Quote
 
=?Utf-8?B?T2xpdmVy?=
Guest
Posts: n/a
 
      9th Sep 2005
Jim,

I was really trying to avoid having modify the application to impersonate a
user (not lazy just time constraints). So I just opened the share for full
access by everyone but no luck. At this rate it will quicker to re-write the
code.



"JIMCO Software" wrote:

>
> In a scenario like this, you should use P/Invoke to do code-level
> impersonation. You can then impersonate a user (or group) who has access to
> that share.
>
> http://support.microsoft.com/default...B;EN-US;306158
>
> See "Impersonate a specific user in code".
>
> --
> Jim Cheshire
> JIMCO Software
> http://www.jimcosoftware.com
>
> FrontPage add-ins for FrontPage 2000 - 2003
>
>
>
>
>

 
Reply With Quote
 
JIMCO Software
Guest
Posts: n/a
 
      9th Sep 2005
Oliver wrote:
> Jim,
>
> I was really trying to avoid having modify the application to
> impersonate a user (not lazy just time constraints). So I just opened
> the share for full access by everyone but no luck. At this rate it
> will quicker to re-write the code.
>


If you are not impersonating, that means that the worker process account is
being used to access the share. It's possible that it's failing because of
that. I would set a password for the process account and then configure an
identical account on the file server. This will allow for pass-through
authentication.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Problem accessing shares on XP John John (MVP) Windows XP Help 0 13th Nov 2008 04:13 AM
accessing shares John Smith Windows XP Networking 1 17th Aug 2006 03:22 PM
Help with accessing network shares =?Utf-8?B?U3dpbGRlbmJlcmc=?= Windows XP Networking 3 13th Jul 2006 08:08 PM
Accessing shares in XP Mats Sparr Windows XP Networking 1 21st Dec 2004 03:01 PM
Accessing XP shares Kevin Microsoft Windows 2000 Networking 2 2nd Jun 2004 06:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:24 AM.