<%@ WebHandler Language="C#" Class="UEditorHandler" %> using System; using System.Web; using System.IO; using System.Collections; using Newtonsoft.Json; public class UEditorHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { UEHandler action = null; switch (context.Request["action"]) { case "config": action = new UEConfigHandler(context); break; case "uploadimage": action = new UEUploadHandler(context, new UEUploadConfig() { AllowExtensions = Config.GetStringList("imageAllowFiles"), PathFormat = Config.GetString("imagePathFormat"), SizeLimit = Config.GetInt("imageMaxSize"), UploadFieldName = Config.GetString("imageFieldName") }); break; case "uploadscrawl": action = new UEUploadHandler(context, new UEUploadConfig() { AllowExtensions = new string[] { ".png" }, PathFormat = Config.GetString("scrawlPathFormat"), SizeLimit = Config.GetInt("scrawlMaxSize"), UploadFieldName = Config.GetString("scrawlFieldName"), Base64 = true, Base64Filename = "scrawl.png" }); break; case "uploadvideo": action = new UEUploadHandler(context, new UEUploadConfig() { AllowExtensions = Config.GetStringList("videoAllowFiles"), PathFormat = Config.GetString("videoPathFormat"), SizeLimit = Config.GetInt("videoMaxSize"), UploadFieldName = Config.GetString("videoFieldName") }); break; case "uploadfile": action = new UEUploadHandler(context, new UEUploadConfig() { AllowExtensions = Config.GetStringList("fileAllowFiles"), PathFormat = Config.GetString("filePathFormat"), SizeLimit = Config.GetInt("fileMaxSize"), UploadFieldName = Config.GetString("fileFieldName") }); break; case "listimage": action = new UEListFileManager(context, UEConfig.GetString("imageManagerListPath"), UEConfig.GetStringList("imageManagerAllowFiles")); break; case "listfile": action = new UEListFileManager(context, UEConfig.GetString("fileManagerListPath"), UEConfig.GetStringList("fileManagerAllowFiles")); break; case "catchimage": action = new UECrawlerHandler(context); break; default: action = new UENotSupportedHandler(context); break; } action.Process(); } public bool IsReusable { get { return false; } } }