Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Synchronize Kentico Staging
public void AddMediaLibraryItem()
{
CMS.Base.SystemContext.WebApplicationPhysicalPath = @"D:\inetpub\wwwroot\Site\CMS";
CMS.DataEngine.CMSApplication.Init();
var libraryName = DateTime.Now.ToString("yyyyMMdd-HHmm");
var library = CreateMediaLibrary(libraryName);
var mediaFile = GetInitializedMediaFile(library);
if (mediaFile != null)
{
MediaFileInfoProvider.SetMediaFileInfo(mediaFile);
CMSWorkerQueue.RunCurrentQueuedWorkers();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment