前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >jquery上传控件uploadify使用备忘

jquery上传控件uploadify使用备忘

作者头像
冰封一夏
发布2019-09-11 15:27:33
9700
发布2019-09-11 15:27:33
举报

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

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

代码语言:javascript
复制
1、在使用位置插入代码
=============================
 <iframe width="450px" src="/uploadify/upload.html?参数" frameborder="no" border="0" marginwidth="0"
        marginheight="0" scrolling="no" allowtransparency="yes"></iframe>
=============================
2、设置参数
   uploader:接收上传文件的页面地址,经过Url编码,必须参数
   fileTypeExts :文件类型,默认【*.*】
   fileTypeDesc :文件类型描述,默认【所有文件】
   multi :是否多选,默认【true】
3、接收文件(可参考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);
                ......
            }
        }
4、文件大小
   默认上传最大文件为100M,当然这需要您web.config已经设置好的

使用如下:

代码语言:javascript
复制
<!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="0" marginwidth="0"
        marginheight="0" scrolling="no" allowtransparency="yes"></iframe>
</body>
</html>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2016-08-05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档