Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }