介绍一个jqurey上传库

jqurey上传库地址http://www.jq22.com/jquery-info103
效果如下:
这里写图片描述

使用方式与官网介绍的相差不多
主要的文件包括
1.jquery.uploadify.js
2.jquery.uploadify.min.js
3.jquery-1.7.2.min.js
4.uploadify.css
5.uploadify.swf
6.uploadify-cancel.png

引用js和样式

<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
    <script src="jquery.uploadify.js" type="text/javascript"></script>
    <script src="jquery.uploadify.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="uploadify.css">

web页面添加控件

<input type="file" name="file_upload" id="file_upload"/>

js调用

 $(function() {
    $('#file_upload').uploadify({
        'swf'      : 'uploadify.swf',
        'uploader' : 'uploadify.php'
        // Put your options here
    });
});

关于 put your options here 部分,可以添加的内容,我们可以在

jquery.uploadify.js中查找
这里写图片描述

特别注意限制文件大小可以用fileSizeLimit来标注大小1M = 1024,大家根据需要限制,同时,控件本身支持无限上传,但是服务器上传有限制需要在
web.config的

<httpRuntime maxRequestLength="888888888" executionTimeout="50000" />

具体长度可以随意设置,本例设置为888888888,还有超时时间。

demo地址

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值