API Questions on Kentico API.
Version 6.x > API > getting error while trying to delete medialibrary folder through api View modes: 
User avatar
Member
Member
shootermv-gmail - 6/3/2012 5:21:14 PM
   
getting error while trying to delete medialibrary folder through api
I'm building some delete media library folder functionality that suppose to act throught jquery ajax. I'm seding request from javascript to some webmethod enabled page, here is my code


[WebMethod]
public static void DeleteDirectory(string LibraryName, string FolderPath)
{

MediaLibraryInfo libraryInfo = MediaLibraryInfoProvider.GetMediaLibraryInfo(LibraryName,CMSContext.CurrentSiteName);
try
{

MediaLibraryInfoProvider.DeleteMediaLibraryFolder(CMSContext.CurrentSiteName, libraryInfo.LibraryID, FolderPath, false);
}catch(Exception exx){

}
}


Foldeer is right and medialibraryname is correct,
But i'm getting following exception:
"Access to the path 'all-wcprops' is denied."

Please help
Thanks forward

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 6/4/2012 3:04:21 AM
   
RE:getting error while trying to delete medialibrary folder through api
Hello.

This seems to be disk permissions issue. Most likely the account, under which your application is running, is not grant by delete or modify permission over the given folder. You can find some additional info at http://devnet.kentico.com/docs/6_0/devguide/disk_permissions_problems.htm, however, you need to consider specifics on your particular scenario (“I'm sending request from JavaScript to some web method”).

Best Regards,
Radek Macalik

User avatar
Member
Member
shootermv-gmail - 6/4/2012 4:04:55 AM
   
RE:getting error while trying to delete medialibrary folder through api
Thanks to all who tried to answer-
The problem was that all directories i trried to remove were 'readonly'
(it became readonly because of svn i'm working with)
once i remove it - all started to work

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 6/4/2012 5:20:53 AM
   
RE:getting error while trying to delete medialibrary folder through api
Hello.

Thank you for sharing the solution with others.

Best Regards,
Radek Macalik