Hl.WebMain/Source/jsplug/jq.xheditor/serverscript/net/Upload.ashx.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.IO;
using System.Text.RegularExpressions;
namespace Hl.WebMain.Source.jsplug.jq.xheditor.serverscript.net
{
/// <summary>
/// Upload 的摘要说明
/// </summary>
public class Upload : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ClearHeaders();
context.Response.Clear();
context.Response.Expires = 0;
context.Response.ClearContent();
#region "申明变量"
string rqtfileHttp = string.IsNullOrEmpty(ConfigurationManager.AppSettings["UpHttp"]) ? "" : ConfigurationManager.AppSettings["UpHttp"];
string rqtFileName = "filedata"; //表单文件域name
string orgFileName = ""; //文件名称[原来]
string newFileName = ""; //文件名称[新的]
string extFileName = ""; //文件后缀名称
string urlFilePath = "/Upload/" + DateTime.Now.ToString("yyyy/MM/dd/HH/mm/ss/"); //文件保存路径
string disposition = context.Request.ServerVariables["HTTP_CONTENT_DISPOSITION"]; //hmtl5文件字节字符
byte[] submitFile; //提交文件
FileData fileData = new FileData();
#endregion
#region "文件上传"
try
{
string saveCurrentPath = context.Server.MapPath(urlFilePath);
if (!Directory.Exists(saveCurrentPath))
{
Directory.CreateDirectory(saveCurrentPath);
}
if (disposition == null)
{
HttpPostedFile postedFile = context.Request.Files[rqtFileName];
submitFile = new Byte[postedFile.ContentLength];
Stream steamFile = postedFile.InputStream;
steamFile.Read(submitFile, 0, postedFile.ContentLength);
steamFile.Close();
// 读取原始文件名
orgFileName = postedFile.FileName;
}
else
{
//hmtl5上传
后面还有 74 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
