K12 SP Media library folder deletion using API

lokendra jain asked on May 8, 2020 21:58

Hi Team,

I am using Kentico CMS 12 with MVC development model. I have used the Kentico media library api and created the upload functionality from MVC site. Now I have a requirement to delete the media library folders inside a particular folder from MVC site. I am able to delete the physical folders from MVC site but its not deleting the same folder from CMS. I am using below code to delete the media library folders from MVC site.

MediaLibraryInfoProvider.DeleteMediaLibraryFolder(SiteContext.CurrentSiteName, library.LibraryID, mediaLibraryPath1, true, false);

Please suggest.



Recent Answers

Brian McKeiver answered on May 9, 2020 17:25 (last edited on May 9, 2020 18:39)

Updated: Lokendra, thanks for following up. I was a little surprised WF tasks weren't kicking in. So yes, the real answer is having a Healthy WebFarm running. The system should generate the task(s) to remove the files for you. Make sure both app pools are up and running.

2 votesVote for this answer Mark as a Correct answer

lokendra jain answered on May 9, 2020 18:34

Hi Brian,

Thanks for your response.

I would like to add to your answer if webfarm server is healthy and we are using media library API it will generate webfarm task automatically which will synchronize both MVC and Admin.

I was executing the code from MVC site. Finally I am able to get the root cause, the directory path was containing \\ in path. I have corrected the folder path and its working fine now.



0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.