Access to the folder is denied

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David C

    #1

    Access to the folder is denied

    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\photo s\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 virtualFolderPa th As String = "Photos/" &
    strFolderName.T oString & "/RO25201"
    Dim folder As New
    DirectoryInfo(S erver.MapPath(v irtualFolderPat h))

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


  • Alexey Smirnov

    #2
    Re: Access to the folder is denied

    On Apr 23, 9:46 pm, "David C" <dlch...@lifeti meinc.comwrote:
    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\photo s\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 virtualFolderPa th As String = "Photos/" &
    strFolderName.T oString & "/RO25201"
                Dim folder As New
    DirectoryInfo(S erver.MapPath(v irtualFolderPat h))
    >
                Dim fileList As FileInfo() = folder.GetFiles ("Initial*.jpg" )
                PicturesInFolde r.DataSource = fileList
                PicturesInFolde r.DataBind()

    Comment

    Working...