Пример #1
0
 //+
 //- @ProcessRequest -//
 public override void Process()
 {
     if (Themelia.Web.Http.GetUrlPart(Themelia.Position.Penultima) == "imagestore")
     {
         Byte[] buffer      = HttpData.GetInputHttpByteArray();
         String contentType = HttpData.GetHeaderItem(Info.ImageContentType);
         if (buffer != null && buffer.Length > 0 && !String.IsNullOrEmpty(contentType))
         {
             String    blogGuid  = Themelia.Web.Http.GetUrlPart(Themelia.Position.Ultima);
             BlogImage blogImage = new BlogImage
             {
                 ContentType = contentType,
                 Data        = buffer
             };
             //+
             try
             {
                 Response.Write(ImageAgent.SaveImage(blogImage, blogGuid));
             }
             catch
             {
             }
         }
         else
         {
             String blogImageGuid = Themelia.Web.Http.GetUrlPart(Themelia.Position.Ultima);
             if (!String.IsNullOrEmpty(blogImageGuid))
             {
                 BlogImage blogImage = ImageAgent.GetImage(blogImageGuid);
                 if (blogImage.Data != null && blogImage.Data.Length > 0)
                 {
                     ContentType = blogImage.ContentType;
                     Response.BinaryWrite(blogImage.Data);
                 }
             }
         }
     }
 }