Directory Permission Grumbles!

J

Jeremy

I have an ASP.net application which needs to retreive images from
multiple remote machines. It is reterieveing images generated by a web
cam service on those machines. All of these machines, including the
development machine are running on the same windows user account. On
the development machine, the app works great.

The other client machines run into directory permission problems when
attemptiong to browse the directory the images are located. When the
this happens, the client is prompted for the username and password of
the development machine (they are the same account...definetly do not
want this prompt)??? but even if they provide the correct username and
password an unauthorized acces exception is encountered:

---------------------------------------------------------------
Access to the path "\\remotedirectory\c$\SQC\" is denied.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the
path "\\remotedirectory\c$\SQC\" is denied.

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS
5 or Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user
(typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in
Explorer, choose "Properties" and select the Security tab. Click "Add"
to add the appropriate user or group. Highlight the ASP.NET account,
and check the boxes for the desired access.

Source Error:


Line 45: Dim Files() As String =
StationDir.GetFiles("\\" & Station & "\c$\SQC\", "myimage.jpg")
Line 46:
Line 47: If Not Files.Length > 0 Then


Source File: C:\Inetpub\wwwroot\WebApplicationTest\QueueCam.aspx.vb
Line: 45

Stack Trace:


[UnauthorizedAccessException: Access to the path
"\\remotedirectory\c$\SQC\" is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
System.IO.Directory.InternalGetFileDirectoryNames(String fullPath,
String userPath, Boolean file) +229
System.IO.Directory.InternalGetFiles(String path, String userPath,
String searchPattern) +24
System.IO.Directory.GetFiles(String path, String searchPattern) +477
WebApplicationTest.QueueCam.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\WebApplicationTest\QueueCam.aspx.vb:45
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
-------------------------------------------------------------

The error message is quite informative...I have tried impersonation set
to true and false, I have tried granting the ASP.NET user permission to
the requested directory and file. But still the same security problem
on client machines only. Does someone have any info they could share on
this or a resource to point me to? Why is it asking for a username and
password to the web server? Thanks in advance for your time!

-Jeremy
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top