Hidistro.UI.Web/Admin/Shop/Hi_Ajax_UploadImg.cs

(完整代码) 1KB

namespace Hidistro.UI.Web.Admin.Shop
{
    using System;
    using System.IO;
    using System.Web;

    public class Hi_Ajax_UploadImg : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Charset = "utf-8";
            HttpPostedFile file = context.Request.Files["Filedata"];
            string path = HttpContext.Current.Server.MapPath(context.Request["folder"]) + @"\";
            if (file != null)
            {
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                file.SaveAs(path + file.FileName);
                context.Response.Write("1");
            }
            else
            {
                context.Response.Write("0");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。