private string GetFilestoreCssPath()
        {
            ICentralizedFile file = InlineContentStore.GetFile("css", "inlinecontent.css");

            if (file == null)
            {
                using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(Css)))
                {
                    file = InlineContentStore.AddUpdateFile("css", "inlinecontent.css", stream);
                }
            }

            return(file.GetDownloadUrl());
        }
        public string GetFilestoreCssPath()
        {
            ICentralizedFile file = EmoticonStore.GetFile("css", "emoticons.css");

            if (file == null)
            {
                using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(_cssToRender)))
                {
                    file = EmoticonStore.AddUpdateFile("css", "emoticons.css", stream);
                }
            }

            return(file.GetDownloadUrl());
        }
Exemplo n.º 3
0
        private void UploadToApplication(HttpContextBase context, HttpPostedFileBase uploadedFile, string jsonId, int defaultHeight, int defaultWidth, StringBuilder returnString)
        {
            string contextId = context.Request.QueryString["uploaderId"] ?? string.Empty;

            if (string.IsNullOrEmpty(contextId))
            {
                throw new Exception("No file was received.");
            }

            string fname = Path.GetFileName(uploadedFile.FileName);

            ICentralizedFile uploadedCfsFile = null;

            var fm = new Telligent.Evolution.Components.MultipleUploadFileManager();

            fm.AddFile(fname, uploadedFile.InputStream, contextId);

            uploadedCfsFile = fm.GetCfsFile(fname, contextId);

            if (uploadedCfsFile != null)
            {
                string resizedHtml = PublicApi.UI.GetResizedImageHtml(CentralizedFileStorage.GetGenericDownloadUrl(uploadedCfsFile), defaultWidth, defaultHeight, new UiGetResizedImageHtmlOptions());

                returnString.Append(string.Concat("{\"" + jsonId + "\":\"", PublicApi.Javascript.Encode(uploadedCfsFile.GetDownloadUrl()), "\",\"resizedMarkup\":\"", PublicApi.Javascript.Encode(resizedHtml), "\",\"filename\":\"" + fname + "\"}"));
            }
        }