Permission denied when I try to create a folder

Discussion in 'Classic ASP' started by ianhills, Mar 3, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. ianhills

    ianhills Ian Hills

    When I try to create a folder in ASP, the code sometimes fails, with Firefox saying

    Microsoft VBScript runtime error '800a0046'
    Permission denied
    /admin/exit.asp, line 34

    'delete and recreate user folder ---------------------------------------------
    If objFSO.FolderExists(Server.MapPath("../users/" & Session("username") & "/")) = True Then objFSO.DeleteFolder(Server.MapPath("../users/" & Session("username") & "/"))

    '------------------------------------------------------------------------
    'this is the line giving me the trouble, according to the browser ------------------------------------------
    Set objFldr = objFSO.CreateFolder(Server.MapPath("../users/" & Session("username") & "/"))

    '-------------------------------------------------------------------------

    Set objFldr = Nothing

    It fails about 1 in 4 times. Can anybody help please?
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    i would dump out the path of the folder everytime it fails and see what the path is.
     
  3. ianhills

    ianhills Ian Hills

    Thanks - I used a kludge

    In the end I thought, never mind createfolder, I'll just use copyfolder from an empty directory to a new one!
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page