Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Local Drive File Permissions

Reply
Thread Tools

Local Drive File Permissions

 
 
Brandon
Guest
Posts: n/a
 
      09-20-2005
Sorry for the cross post. I posted this in web services general, but after
thinking about it, I think it will get more hits here in asp.net web
services. I'm on Windows XP Pro running a web service on my local pc (which
will eventually be moved up to a server). I need to access several files on
my local hard drive (ultimately the server's hard drive) from the web
service. I'm running into a file access problem with this. To illustrate my
problem, I've got it really stripped down. Here is a web service in c# ...

using System.IO;
....
[WebMethod]
public string OpenFile()
{
string retVal = "OK";
try
{
FileStream fs = new FileStream("c:\\hello.txt", FileMode.Open);
}
catch ( Exception e )
{
retVal = e.Message;
}
return retVal;
}

When I browse to this service in IE and Invoke the OpenFile method, my
return value is "Access to the path "c:\hello.txt" is denied."

I've tried changing my IUSR_BRANDON user to be a member of the Administrator
group. I've changed the anonymous access user to Administrator. Let IIS
control password as well as type it in explicitly. I've fooled around with
several things, but nothing I change or flip seems to have any effect.

This should be pretty easy shouldn't it? I mean, the asp.net process should
be able to see the local drive right? Any help will be greatly appreciated.
I'm beating my head on the keyboard here.

Thanks is advance,
Brandon Parks
http://www.velocityreviews.com/forums/(E-Mail Removed) (remove spamfree)

 
Reply With Quote
 
 
 
 
Luca Morelli
Guest
Posts: n/a
 
      09-20-2005
if i remember well there is an ASPNET user that is used by the asp.net
processes.
I suggest that if you want less problems read froma directory with
FullAccess to everyone rights.

"Brandon" <(E-Mail Removed)> ha scritto nel messaggio
news:(E-Mail Removed)...
> Sorry for the cross post. I posted this in web services general, but after
> thinking about it, I think it will get more hits here in asp.net web
> services. I'm on Windows XP Pro running a web service on my local pc
> (which
> will eventually be moved up to a server). I need to access several files
> on
> my local hard drive (ultimately the server's hard drive) from the web
> service. I'm running into a file access problem with this. To illustrate
> my
> problem, I've got it really stripped down. Here is a web service in c# ...
>
> using System.IO;
> ...
> [WebMethod]
> public string OpenFile()
> {
> string retVal = "OK";
> try
> {
> FileStream fs = new FileStream("c:\\hello.txt", FileMode.Open);
> }
> catch ( Exception e )
> {
> retVal = e.Message;
> }
> return retVal;
> }
>
> When I browse to this service in IE and Invoke the OpenFile method, my
> return value is "Access to the path "c:\hello.txt" is denied."
>
> I've tried changing my IUSR_BRANDON user to be a member of the
> Administrator
> group. I've changed the anonymous access user to Administrator. Let IIS
> control password as well as type it in explicitly. I've fooled around with
> several things, but nothing I change or flip seems to have any effect.
>
> This should be pretty easy shouldn't it? I mean, the asp.net process
> should
> be able to see the local drive right? Any help will be greatly
> appreciated.
> I'm beating my head on the keyboard here.
>
> Thanks is advance,
> Brandon Parks
> (E-Mail Removed) (remove spamfree)
>



 
Reply With Quote
 
 
 
 
Kumar Shetgar
Guest
Posts: n/a
 
      10-06-2005
I would not give FullAccess to Everyone. Its not secure..
You can try adding IIS_WPG to the user names and that should solve it.

If it doesnt work...give access to "Network Service" and try it.

-- Kumar Shetgar


"Luca Morelli" wrote:

> if i remember well there is an ASPNET user that is used by the asp.net
> processes.
> I suggest that if you want less problems read froma directory with
> FullAccess to everyone rights.
>
> "Brandon" <(E-Mail Removed)> ha scritto nel messaggio
> news:(E-Mail Removed)...
> > Sorry for the cross post. I posted this in web services general, but after
> > thinking about it, I think it will get more hits here in asp.net web
> > services. I'm on Windows XP Pro running a web service on my local pc
> > (which
> > will eventually be moved up to a server). I need to access several files
> > on
> > my local hard drive (ultimately the server's hard drive) from the web
> > service. I'm running into a file access problem with this. To illustrate
> > my
> > problem, I've got it really stripped down. Here is a web service in c# ...
> >
> > using System.IO;
> > ...
> > [WebMethod]
> > public string OpenFile()
> > {
> > string retVal = "OK";
> > try
> > {
> > FileStream fs = new FileStream("c:\\hello.txt", FileMode.Open);
> > }
> > catch ( Exception e )
> > {
> > retVal = e.Message;
> > }
> > return retVal;
> > }
> >
> > When I browse to this service in IE and Invoke the OpenFile method, my
> > return value is "Access to the path "c:\hello.txt" is denied."
> >
> > I've tried changing my IUSR_BRANDON user to be a member of the
> > Administrator
> > group. I've changed the anonymous access user to Administrator. Let IIS
> > control password as well as type it in explicitly. I've fooled around with
> > several things, but nothing I change or flip seems to have any effect.
> >
> > This should be pretty easy shouldn't it? I mean, the asp.net process
> > should
> > be able to see the local drive right? Any help will be greatly
> > appreciated.
> > I'm beating my head on the keyboard here.
> >
> > Thanks is advance,
> > Brandon Parks
> > (E-Mail Removed) (remove spamfree)
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
In-depth documenation on User Permissions, Group Permissions, ACLs, DCLs etc. Curt K ASP .Net 0 11-03-2006 04:54 PM
ASPNET permissions woe - even when writing to a local drive that is mapped jimmyfishbean@yahoo.co.uk ASP .Net 3 09-12-2005 04:35 PM
Playing a local mpeg file from a local HTML file... Lyndon HTML 1 07-25-2005 02:21 AM
ASPX file returning obscur runtime error - after changing permissions to a subweb (.net app) to different permissions than on its parent ? Isabelle ASP .Net 0 08-11-2004 02:04 PM
Re: Permissions - giving "everyone" full permissions is bad ? Scott Allen ASP .Net 0 07-13-2004 08:54 PM



Advertisments