public MetaWeblog.UrlInfo metaweblog_newMediaObject(object blogid, string username, string password, MetaWeblog.MediaType enc) { VerifyAccess(username, password); Stream stream = new MemoryStream(enc.bits); var filePath = binaryManager.SaveFile(stream, enc.name); var urlInfo = new MetaWeblog.UrlInfo { url = filePath }; return(urlInfo); }
public MetaWeblog.UrlInfo metaweblog_newMediaObject(object blogid, string username, string password, MetaWeblog.MediaType enc) { VerifyAccess(username, password); Stream stream = new MemoryStream(enc.bits); var filePath = binaryManager.SaveFile(stream, enc.name); var urlInfo = new MetaWeblog.UrlInfo { url = Path.Combine(dasBlogSettings.RelativeToRoot(dasBlogSettings.SiteConfiguration.BinariesDir.TrimStart('~', '/')), enc.name) }; return(urlInfo); }
public MetaWeblog.UrlInfo metaweblog_newMediaObject(object blogid, string username, string password, MetaWeblog.MediaType enc) { if (!dasBlogSettings.SiteConfiguration.EnableBloggerApi) { throw new ServiceDisabledException(); } if (!VerifyLogin(username, password)) { throw new SecurityException(); } Stream stream = new MemoryStream(enc.bits); var filePath = binaryManager.SaveFile(stream, enc.name); var urlInfo = new MetaWeblog.UrlInfo { url = Path.Combine(dasBlogSettings.RelativeToRoot(dasBlogSettings.SiteConfiguration.BinariesDir.TrimStart('~', '/')), enc.name) }; return(urlInfo); }