funnyque / easyupload.js Goto Github PK
View Code? Open in Web Editor NEW一款简单易用、可配置的H5/Web上传插件。支持多文件上传,批量上传,混合上传,以及多实例上传。
Home Page: https://funnyque.github.io/easyUpload.js/
License: MIT License
一款简单易用、可配置的H5/Web上传插件。支持多文件上传,批量上传,混合上传,以及多实例上传。
Home Page: https://funnyque.github.io/easyUpload.js/
License: MIT License
请问文件可以切片吗?
btnText建议增加排序 和显示隐藏
如果我不想要 终止按钮 不知道怎么隐藏
我想让上传按钮在最后面 不知道怎么调整
btnText: { //按钮展示文字
select: '选择文件',
upload: '上传',
delete: '删除',
cancel: '终止'
},
这个插件,除了进度条不是实时显示外(由定时器触发),其他功能就非常齐全完美了,如果可以把进度条实时化,就太完美了。
加入了accept配置后,还是可以上传别的类型的文件,这个accept好像只是在input中加入了个accept属性,并没有在选择文件时候做限制吗
你好,我发现了下面几个问题:
1、缺失默认的Ajax头X-Requested-With: XMLHttpRequest
,虽然不是http标准的头信息,但是很多后端框架都用这个头来判断是否为Ajax请求。
2、Content-Type
设置错误,Ajax以表单形式上传文件的时候这头应该是自动生成的,此时Ajax配置应该为:contentType: false
。
3、拦截器那块的代码现在是全局设置的,会影响其它的Ajax行为,应该将其设置成单独的:
startInterceptor: function() {
var that = this;
that.ajax.target = {
crossDomain: that.configs.crossDomain,
xhrFields: {
withCredentials: that.configs.withCredentials
},
beforeSend: function () {
that.configs.beforeUpload && that.configs.beforeUpload(that.files[that.ajax.index], that.configs.data, arguments);
}
};
},
然后再在请求之前合并这些配置:
var options = $.ajaxSetup(that.ajax.target, {url: that.configs.action});
this.ajax.example = $.ajax(options);
4、建议用Promise.all()
方法让所有请求结束后有个回调函数。
无法在单个页面创建多个实例,后面的配置会覆盖前面的
代码78行左右
if (target[key] != undefined) { target[key] = source2[key] }
需要修改成
if(typeof (target[key]) != 'undefined'){ target[key] = source2[key] }
else if (countDiff <= 0 && fileSize > that.configs.maxCount) { message = '文件大小超出,当前文件' + fileSize + 'M,允许大小为' + that.configs.maxSize + 'M'; onAlert(message); }
easyUploader.jq.js文件中上处代码判断中的maxCount应该改为maxSize
我想实现点开这个控件的时候,如果以前有上传的文件,需要加载到列表上,并且在再选择文件上传的时候,要追加到已上传文件下面
删除有没有event事件呢
如果 没有上传成功 删除 建议加入event事件
进度条走完,显示失败,这个上传地址的问题吗?
当前开启multiple: true后,默认是没有选中的,是否有参数设置让默认选中?
兼容性怎么样呢?兼容ie8吗?
建议增加minio支持
参考
http://www.hushowly.com/articles/2106
HTML 文件上传
tiff,tif文件上传会默认显示img 标签预览 但是没有办法预览
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.