Git Product home page Git Product logo

funnyque / easyupload.js Goto Github PK

View Code? Open in Web Editor NEW
92.0 92.0 45.0 2.41 MB

一款简单易用、可配置的H5/Web上传插件。支持多文件上传,批量上传,混合上传,以及多实例上传。

Home Page: https://funnyque.github.io/easyUpload.js/

License: MIT License

CSS 27.54% HTML 11.25% JavaScript 61.21%
ajax base64 file-upload formdata html5 javascript multiple-upload xmlhttprequest

easyupload.js's People

Contributors

funnyque avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

easyupload.js's Issues

切片

请问文件可以切片吗?

btnText建议增加排序 和显示隐藏

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()方法让所有请求结束后有个回调函数。

建议配置中添加外部验证的方法参数

image
建议在配置用添加添加外部验证的方法参数,并在此处调用,当然如果没配置该参数那就不调用,
因为这个插件没有验证文件重复,但是有些情况下不想上传重复的文件,所以需要自己验证是否重复,
至于怎么验证重复,是根据文件名称在当前队列中还是到服务器验证重复,用户自己考虑,
插件只管判断该配置方法返回的true/false判断是否要添加队列就行了

参数复制问题

代码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

上传失败

进度条走完,显示失败,这个上传地址的问题吗?

兼容性

兼容性怎么样呢?兼容ie8吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.