27 Star 32 Fork 7

唐明 / jQuery_image_muti_upload

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

##jquery多文件图片上传插件 浙江省新昌县城西小学 唐明 qq:147885198

##主要功能:

  1. 支持拖放上传和文件选择上传
  2. 图片可自定义最大尺寸,js自动缩小后上传
  3. 上传base64编码后的文件信息,服务端需要进行解码保存
  4. 有上传进度显示,共几个文件,每个文件的上传进度。
  5. 当前只支持HTML5浏览器,尤其是对canvas、filereader的支持

##构造参数:

  • file_list 文件列表,一般在input type=file中获得,或是在拖放对象中获得
  • url 服务端上传处理地址
  • opt 设置
  • max --图片允许最大高度或宽度 数值:默认1600
  • allow_ext --允许上传的图片类型 数组:['.jpg','.png','.gif']
  • img_compress--是否压缩图片 布尔:默认true
  • post_data --发送到服务器的POST数据 object
  • call_back --所有图片上传完毕 function

##改进列表##

  • 2015-11-3 创作
  • 2015-11-13
  • POST时增加文件名filename参数
  • opt参数增加2项
  • post_data --发送到服务器的POST数据 object
  • call_back --所有图片上传完毕时回调 function

2015-11-16 增加window.URL.revokeObjectURL(this.src)用于释放资源

##主要问题:##

  1. 上传进度不明显
  2. 不压缩图片时,如果图片太大,base64后会更大,可能会超过服务器post限制

使用方法:绑定input type="file"的change事件

2015-12-7 修改组件使用方式
1.发现$.inArray有错误,自己实现一个。
2.不使用原型继承,使用闭包方式存储数据。
3.修复单文件上传时发生的错误

使用方法:绑定input type="file"的change事件

$('#file1').on('change',upload_files);
function upload_files(){
$.upload_muti.init(fileList,'upload_do.php',{max:2000,callback:upload_close,post_data:{path_id:path_id}});
$.upload_muti.start();
}
The MIT License (MIT) Copyright (c) 2015 李逍m Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

这是一个jQuery多图片上传组件,可以在客户端对图片进行缩放。可以显示上传进度。 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/tmnet/jQuery_image_muti_upload.git
git@gitee.com:tmnet/jQuery_image_muti_upload.git
tmnet
jQuery_image_muti_upload
jQuery_image_muti_upload
master

搜索帮助