Uploadify.ashx

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<%@ WebHandler Language="C#" Class="Uploadify" %>

using System;
using System.Web;
using System.IO;
using WebClass;

public class Uploadify : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
       // context.Response.Write("Hello World");
        HttpPostedFile fileUpload = context.Request.Files["Filedata"];//获取上传文件方式二
        int qiyeid = 0;
        string qiyeming = "";
        int xiangguanid = 0;
        int shengpiid = 0;
        int type = 0;
        
        if (context.Request["qiyeid"]!=null)
        int.TryParse(context.Request["qiyeid"].ToString(),out qiyeid);
        if (context.Request["qiyeming"] != null)
            qiyeming = context.Request["qiyeming"].ToString();


        if (context.Request["xiangguanid"] != null)
            int.TryParse(context.Request["xiangguanid"].ToString(), out xiangguanid);

        if (context.Request["shengpiid"] != null)
            int.TryParse(context.Request["shengpiid"].ToString(), out shengpiid);

        if (context.Request["type"] != null)
            int.TryParse(context.Request["type"].ToString(), out type);
        
        if (fileUpload != null)
        {

            string attachName = fileUpload.FileName;
            int filesize = fileUpload.ContentLength;
            
           
            if (filesize > 0)
            {
                int dotposition = attachName.IndexOf(".");
                string extendName = System.IO.Path.GetExtension(fileUpload.FileName).ToLower();

                if (attachName.EndsWith(".xls") || attachName.EndsWith(".xlsx") ||attachName.EndsWith(".doc")
                    || attachName.EndsWith(".docx") || attachName.EndsWith(".pdf") || attachName.EndsWith(".bmp")
                    || attachName.EndsWith(".jpg") || attachName.EndsWith(".JPG") || attachName.EndsWith(".gif") || attachName.EndsWith(".png") || attachName.EndsWith(".jpeg")
                    )
                {
                    string filepath ="";
                    
                    if(type==14)
                        filepath = hasfile(getUploadFilepath() + attachName, getUploadFilepath(), extendName);
                    else
                        filepath = hasfile(getUploadFilepath2() + attachName, getUploadFilepath2(), extendName);
                    string saveAsfilePathName = filepath;
                    fileUpload.SaveAs(saveAsfilePathName);

后面还有 100 行代码,购买后查看完整代码

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

AI 解读

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

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