Access to the folder is denied

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

I have a virtual folder on a web site that links to a shared folder on a 2nd
server. When I try to access it in my aspx page I get the following error:

Access to the path '\\server\photos\Hamelin, Jose\RO25201' is denied.

I gave the photos folder access from network service, anonymous, etc. and
still no luck. I even tried the "Connect as..." button in the IIS
properties but that did not work either.
Below is the aspx code and it fails on the GetFiles method. If I physically
type the file path into the browser, it displays the files in that folder.
Can anyone help? Thanks.

David

strFolderName = "Hamelin, Jose"
'Get information about the files in the specified folder
Dim virtualFolderPath As String = "Photos/" &
strFolderName.ToString & "/RO25201"
Dim folder As New
DirectoryInfo(Server.MapPath(virtualFolderPath))

Dim fileList As FileInfo() = folder.GetFiles("Initial*.jpg")
PicturesInFolder.DataSource = fileList
PicturesInFolder.DataBind()
 
I have a virtual folder on a web site that links to a shared folder on a 2nd
server.  When I try to access it in my aspx page I get the following error:

Access to the path '\\server\photos\Hamelin, Jose\RO25201' is denied.

I gave the photos folder access from network service, anonymous, etc. and
still no luck.  I even tried the "Connect as..." button in the IIS
properties but that did not work either.
Below is the aspx code and it fails on the GetFiles method.  If I physically
type the file path into the browser, it displays the files in that folder.
Can anyone help?  Thanks.

David

            strFolderName = "Hamelin, Jose"
            'Get information about the files in the specified folder
            Dim virtualFolderPath As String = "Photos/" &
strFolderName.ToString & "/RO25201"
            Dim folder As New
DirectoryInfo(Server.MapPath(virtualFolderPath))

            Dim fileList As FileInfo() = folder.GetFiles("Initial*.jpg")
            PicturesInFolder.DataSource = fileList
            PicturesInFolder.DataBind()

http://groups.google.com/group/micr...read/thread/ec9a28d4bb655c14/cf3ed675b1609854
 
Back
Top