//create folder
var uploadFolder = "upload";
_mediaLibraryService.CreateFolder(contentItem.ContentType, uploadFolder);
//upload file
var stream = File.Open(file.FullName, FileMode.Open, FileAccess.Read);
var mediaPart = _mediaLibraryService.ImportMedia(stream, destDirPath.Replace("\\", "/"), file.Name, "");
_contentManager.Create(mediaPart);
_contentManager.Publish(media.ContentItem);