コード例 #1
0
        private static void RemoteUpdateImages()
        {
            decimal       d             = HttpContext.Current.Request["hidFileMaxSize"].ToDecimal(0);
            StringBuilder stringBuilder = new StringBuilder();
            string        url           = Globals.GetImageServerUrl() + "/admin/UploadHandler.ashx?action=newupload";

            if (d <= decimal.Zero)
            {
                d = 2m;
            }
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("foldName", HttpContext.Current.Request["foldName"].ToNullString());
            for (int i = 0; i < HttpContext.Current.Request.Files.Count; i++)
            {
                HttpPostedFile postedFile = HttpContext.Current.Request.Files[i];
                string         empty      = string.Empty;
                UploadHandler.HttpPostFile(url, postedFile, dictionary, ref empty);
                stringBuilder.Append(empty + ",");
            }
            HttpContext.Current.Response.Write(stringBuilder.ToString().TrimEnd(','));
        }
コード例 #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.AddHeader("Access-Control-Allow-Origin", "*");
            context.Response.ContentType = "text/plain";
            HttpRequest request = context.Request;
            string      text    = request["action"];

            switch (text)
            {
            case "upload":
                this.UploadImage();
                break;

            case "newupload":
                this.NewUploadImage();
                break;

            case "remoteupdateimages":
                UploadHandler.RemoteUpdateImages();
                break;

            case "oldupload":
                this.OldUpload(context);
                break;

            case "delete":
                this.DeleteImage();
                break;

            case "olddelete":
                this.DoDelete(context);
                break;

            default:
                context.Response.Write("false");
                break;
            }
        }