日期:2014-05-17 浏览次数:20438 次
$("#uploadify").uploadify({
'uploader': 'Js/jquery.uploadify-v2.1.4/uploadify.swf',
'script': 'UploadHandler.ashx',//引用Handler
'buttonImg':'Js/jquery.uploadify-v2.1.4/select.gif',//选择文件按钮
'cancelImg': 'Js/jquery.uploadify-v2.1.4/cancel.gif',//取消上传按钮
'width': 150,//按钮宽度
'height': 54,//按钮高度
'wmode': 'transparent',//使浏览按钮的flash背景文件透明
<%@ WebHandler Language="C#" Class="UploadHandler" %>
using System;
using System.Web;
using System.IO;
public class UploadHandler : IHttpHandler {
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Charset = "utf-8";
HttpPostedFile file = context.Request.Files["Filedata"];
string uploadPath = HttpContext.Current.Server.MapPath(@context.Request["folder"]) + "\\";