Create New Directory

Last post 09-14-2010, 1:20 PM by Eric. 3 replies.
Sort Posts: Previous Next
  •  08-24-2010, 10:30 PM 63603

    Create New Directory

    I am using an older version than the current one, but sorry I don't know how to tell you which one it is.
    I was asked by a client to see if I can fix something.
     
    They want to be able to insert new folders into an upload directory. I check the permissions on the folder (Host settings) and they are set to allow edit, creation and deletion. I created the folder and uploaded it, but still would like to see if I can solve this functionality.
     
    Also changed all three config files to 'True' in the positions as displayed below. I did have the 'True' as 'true' and changed that, but no result.
    When I attempt to create a new folder, nothing appears or happens.
     
    I can upload images into the folder and then insert them on the page. I cannot create a new folder or change any of the exisiting folders.
    Any troubleshooting would be appreciated. Thanks

    Here is a snippet from the config file:
     
     <security name="AllowUpload">true</security>
     <security name="AllowCreateFolder">True</security>
     <security name="AllowRename">True</security>
     <security name="AllowDelete">True</security>
     <security name="ImageFilters">

    Here is the function embedded in the page that loads the images:
     
    function CreateDir_click()
     {
      <%
       if not CBool(AllowCreateFolder) then
      %>
       alert("<%= GetString("Disabled")%>");
       return;
      <%
       End If
      %>
        
      var dir=prompt("<%= GetString("SpecifyNewFolderName")%>","")
      if(dir)
      {
       var tempPath = browse_Frame.contentWindow.location; 
       tempPath = tempPath + "&action=createfolder&foldername="+dir;
       browse_Frame.contentWindow.location = tempPath;   
      }
     }
    Thanks for your help, Keith

    Self praise is no recommendation
  •  08-25-2010, 8:50 AM 63611 in reply to 63603

    Re: Create New Directory

    Please refer to http://cutesoft.net/asp/document/scr/Specifying-images-path.htm, the default image gallery path is "Uploads", if you create new folder, "Uploads" will be the parent folder of the new created folder. Please grant user write permission of folder "Uploads" and try it again.
     
    Regards,
    Eric 
  •  09-11-2010, 1:32 AM 63933 in reply to 63611

    Re: Create New Directory

    I have the same problem. All configs allow to create a new folder, The images path is set using this way:
     
    var imagesPath = EnsureImageGalleryPath();

    Editor.SetSecurityImageGalleryPath(imagesPath);
    Editor.SetSecurityImageBrowserPath(imagesPath);
    The "imagesPath" does exist and allows full control to user Everyone. I tryed to add my own test handler and create a new folder myself (code from InsertImage.aspx):
     
    public void CreateDir1_Click(object sender, EventArgs e)
    {
        try
        {
            
            System.IO.Directory.CreateDirectory("D:\\MyUserFileStorage\\Serge\\Images\\Test");
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
     
    The Test subfolder was created without any problems. But when I'm trying to do the same using you way, the control does not create a new folder. No messages, no errors, no folder.
     
    The site path is http://localhost/sitename
    Windows 2008 Server R2
    CuteEditor 6.6
    IE 8, FF 3.6.8
     
    Update: 
    I can't: visit the subfolder by clicking on it, rename the file.
    I can: upload an image, delete a file or folder
     
  •  09-14-2010, 1:20 PM 63998 in reply to 63933

    Re: Create New Directory

    Dear SergeGusev ,
     
    Please refer to the following snippet:
     
             if (!Directory.Exists(@"D:\\MyUserFileStorage\\Serge\\Images\\Test"))
             {
                  Directory.CreateDirectory(@"D:\\MyUserFileStorage\\Serge\\Images\\Test");
             }       
             Editor1.SetSecurityImageGalleryPath("~/Images/Test");
     
    Thank you for asking
View as RSS news feed in XML