When an editor is uploading an image, a new folder is created in a specific directory (a sub-directory in another sub-directory of the root folder) and different sizes of the image are created and stored in the folder.
My problem is that I will not see the folder in the asset pane unless I reload the page. I am wondering what part of the code is messing up or if it is the location that I am trying to create the new folder.
var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
//where new Models.Media.ImageFile().MediaFolder is the content reference of folder that the new folder should be created
var contentAssetFolder = contentRepository.GetDefault<ContentAssetFolder>(new Models.Media.ImageFile().MediaFolder);
contentAssetFolder.Name = content.Name.Substring(0, Path.GetExtension(content.Name).Length) + "_" + System.DateTime.Now.ToString("M-d-yy");
return contentRepository.Save(contentAssetFolder, SaveAction.Publish, AccessLevel.NoAccess);