tag: des blog OS Io ar Div amp new
Try {sitecore. resources. media. mediacreatoroptions Options = new sitecore. resources. media. mediacreatoroptions (); options. database = sitecore. configuration. factory. getdatabase ("master"); options. language = sitecore. globalization. language. parse (sitecore. configuration. settings. defaultlanguage); options. versioned = sitecore. configuration. settings. media. uploadasversionablebydefault; options. destination = "/sitecore/Media Library/Pampers/images/expert/doctor1"; options. filebased = sitecore. configuration. settings. media. uploadasfiles; string filepath = "E: \ doctor1.png"; sitecore. data. items. mediaitem samplemedia = mediamanager. creator. createfromfile (filepath, options); this. diverror. innertext = samplemedia. id. tostring ();} catch (exception ex) {This. diverror. innertext = ex. message ;}