基本信息
源码名称:jquery.uploadify 上传文件实例源码下载
源码大小:0.05M
文件格式:.rar
开发语言:C#
更新时间:2015-01-27
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 4 元 
   源码介绍

Handler 里的文件 主要是创建文件夹 和文件用的.
Upload 里的Index文件 是前台的调用 取你需要的
UploadFile 我们这边是临时文件夹 上传成功 会吧文件删除 根据你的需求 不删就不用掉删除方法 DelFiles()
uploadify 是他的源生js和css
我们这边用的是MVC UploadController.cs 是控制器文件 里边有的方法是根据自己业务写的.
UploadFileService 这个底层方法 里边有读取临时文件夹的 文档数据的方法 GetFileTempList()

我把涉及到的 文件 都放进去了. 你可以根据代码看一下  
这玩意我也没研究过 你先往你程序里套一下 哪不对咱在研究研究.

网络商场示例

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using Icloudflag.HT8610HR.Business.Service;

namespace Icloudflag.HT8610HR.Web.Handler
{
    /// <summary>
    /// UploadHandler 的摘要说明
    /// </summary>
    public class UploadHandler : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            switch (context.Request.QueryString["Type"])
            {
                case "1":
                    SaveFiles(context);
                    break;
                case "2":
                    SaveFilesForExcel(context);
                    break;
                default:
                    break;
            }

        }
        public void SaveFiles(HttpContext context)
        {
            Guid BatchID = Guid.Parse(context.Request.QueryString["BatchID"]);
            short DeclarantType = short.Parse(context.Request.QueryString["DeclarantType"]);
            int UploadType = int.Parse(context.Request.QueryString["UploadType"].ToString());

            string UserID = Icloudflag.HT8610HR.Business.AuthorizeService.CurrentUserId;
            string UploadTempPath = Path.Combine(UploadFileService.ServerPath, "Content", "UploadFile", UserID);

            HttpPostedFile file = context.Request.Files["Filedata"];

            string[] subFolders = new string[] { "Content", "UploadFile", UserID };
            UploadFileService.TryToCreateDirectory(UploadFileService.ServerPath, subFolders.ToList());
            //if (!Directory.Exists(UploadTempPath))
            //{
            //    Directory.CreateDirectory(UploadTempPath);
            //}

            if (file != null)
            {
                file.SaveAs(Path.Combine(UploadTempPath, file.FileName));
            }
            else
            {
                context.Response.Write("0");
            }
        }

        public void SaveFilesForExcel(HttpContext context)
        {
            Guid BatchID = Guid.Parse(context.Request.QueryString["BatchID"]);
            short DeclarantType = short.Parse(context.Request.QueryString["DeclarantType"]);
            int UploadType = int.Parse(context.Request.QueryString["UploadType"].ToString());

            string UserID = Icloudflag.HT8610HR.Business.AuthorizeService.CurrentUserId;

            string UploadTempPath = Path.Combine(UploadFileService.ServerPath, "Content", "UploadFile", UserID);

            HttpPostedFile file = context.Request.Files["Filedata"];

            string[] subFolders = new string[] { "Content", "UploadFile", UserID };
            UploadFileService.TryToCreateDirectory(UploadFileService.ServerPath, subFolders.ToList());
            //if (!Directory.Exists(UploadTempPath))
            //{
            //    Directory.CreateDirectory(UploadTempPath);
            //}

            if (file != null)
            {
                file.SaveAs(Path.Combine(UploadTempPath, file.FileName));
            }
            else
            {
                context.Response.Write("0");
            }
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}