Re: Error when on CreateSubdirectory in Web App

From: David Lindahl (david.johansson_at_releye.se)
Date: 02/20/05

  • Next message: DalePres: "Re: Check group member ship or a user"
    Date: Sun, 20 Feb 2005 14:52:41 +0100
    
    

    I don't know if d: is a physical drive. I don't know for sure that the code
    is running in the context of the ASPNET-account.
    I am using <identity impersonate="true"/> in my web.config though.
    I will send these questions to the host support and get back to this thread
    with the info.

    "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
    news:uJjkxH1FFHA.1396@tk2msftngp13.phx.gbl...
    > Do you know if the D: drive is actually a physical drive on the web server
    > machine? Might it be a mapped drive? Also, are you sure the code is
    > running in the context of the ASPNET user?
    >
    >
    > "David Lindahl" <david.johansson@releye.se> wrote in message
    > news:uZcNUv0FFHA.2824@tk2msftngp13.phx.gbl...
    >> The value of sDir is in my case "d:\WebRoot\kvarteret.se\FS
    >> Code used is: Dim sDir As String =
    >> Request.ServerVariables("APPL_PHYSICAL_PATH").ToString & "\FS"
    >>
    >> aDir is a valid object and aDir.Exists returns true.
    >> I instructed the host to grant ASPNET-account full access to the
    >> FS-directory.
    >> Still can't create subfolders...
    >>
    >> Regards
    >> /David
    >>
    >>
    >>
    >>
    >> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
    >> news:%23pQ2axzFFHA.3608@TK2MSFTNGP14.phx.gbl...
    >>> Unfortunately, you haven't provided quite enough information to isolate
    >>> the problem. For starters, do you know what the values of the sDir and
    >>> aDir variables are when the code fails? If you're not sure how to
    >>> determine this, one quick approach would be to wrap the
    >>> "aDir.CreateSubdirectory("test")" line in a try/catch statement that
    >>> writes the variable values to a label or other control on your page when
    >>> the code fails.
    >>>
    >>>
    >>>
    >>> "David Lindahl" <david.johansson@releye.se> wrote in message
    >>> news:O4AalTzFFHA.1476@TK2MSFTNGP09.phx.gbl...
    >>>>I run a web application that allows users to create folders and upload
    >>>>files to the server.
    >>>>
    >>>> Since a while it does not work. I guess it is some kind of
    >>>> securityproblem. Using a host I do not have full access to setting
    >>>> security. Can anyone help me instructing my host of required
    >>>> securitysettings or what code modifications are neccesary to solve this
    >>>> problem.
    >>>>
    >>>> Code used:
    >>>>
    >>>>
    >>>> Dim sDir As String =
    >>>> Request.ServerVariables("APPL_PHYSICAL_PATH").ToString
    >>>> Dim aDir As DirectoryInfo = New DirectoryInfo(sDir)
    >>>> If aDir.Exists Then
    >>>> aDir.CreateSubdirectory("test")
    >>>> End If
    >>>>
    >>>> Exception:System.IO.DirectoryNotFoundException: Could not find a part
    >>>> of the path.
    >>>> at System.IO.__Error.WinIOError(Int32 errorCode, String str)
    >>>> at System.IO.Directory.InternalCreateDirectory(String fullPath,
    >>>> String path)
    >>>> at System.IO.DirectoryInfo.CreateSubdirectory(String path)
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >


  • Next message: DalePres: "Re: Check group member ship or a user"
  • Quantcast