jquery上传控件uploadify使用备忘

时间:2023-03-08 22:15:27

我简单修改了js和样式,效果如下

jquery上传控件uploadify使用备忘

使用起来也是超简单,将文件下载并解压到你网站目录下,然后

、在使用位置插入代码
=============================
<iframe width="450px" src="/uploadify/upload.html?参数" frameborder="no" border="" marginwidth=""
marginheight="" scrolling="no" allowtransparency="yes"></iframe>
=============================
、设置参数
uploader:接收上传文件的页面地址,经过Url编码,必须参数
fileTypeExts :文件类型,默认【*.*】
fileTypeDesc :文件类型描述,默认【所有文件】
multi :是否多选,默认【true】
、接收文件(可参考upload.ashx)
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Charset = "utf-8";
HttpPostedFile file = context.Request.Files["Filedata"];
if (file != null)
{
file.SaveAs(uploadPath + file.FileName);
......
}
}
、文件大小
默认上传最大文件为100M,当然这需要您web.config已经设置好的

使用如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title> </head>
<body>
<iframe width="450px" src="/uploadify/upload.html?参数" frameborder="no" border="" marginwidth=""
marginheight="" scrolling="no" allowtransparency="yes"></iframe>
</body>
</html>

更多的参数描述请看官网  http://www.uploadify.com/

下载链接: http://pan.baidu.com/s/1jI8nBDW 密码: 4f4i