Giter Site home page Giter Site logo

upload's Issues

是否支持跨域上传?

1 是否支持跨域上传?
2 我在本地clone了demo 但是不工作 是否跟 spm3 有关?我目前是spm2

在bootstrap的modal中使用存在问题

在bootstrap的modal中使用,input[type="file"]元素定位出现问题,IE8中文件选择按钮的type属性不是file。晚上继续调试,估计是样式问题造成的。

是否不支持firefox

按要求配置文件後,在IE8(不支持多文件上傳)及chrome能運行。
但是firefox下沒有效果,隻是閃了一下。
firefox版本6.02

同一文件change触发问题

同一文件不能触发多次(未上传成功时候)
Uploader.prototype.bindInput方法内加入refreshInput方法

IE8:上传到七牛的问题

coffeescript代码如下:

   @uploader = new Uploader
      name: 'file'
      size: 2048000
      trigger: @$("#btn-upload")
      action: "http://upload.qiniu.com"
      data: {token: @upload_token}
      accept: 'image/*'
      multiple: false
  .success (data) =>
      console.log data

ff,chrome,IE9+都没问题,在IE8中,上传文件后,出现下载文件提示,下载的文件内容就是七牛返回的内容

在demo.html中尝试 action: '/' 正常,action: '//upload.qiniu.com' 提示下载文件

不能重复提交同一个文件

如果第一次选中了文件a.jpg,等上传完成后如果再想重新上传a.jpg文件,此时继续选择该文件的话,不会触发onchang事件,该如何破???

ie8 下iframe 返回json问题

会返回

{json: "json"}

182行: response = $(this).contents().find("body").html();
建议修改为
response = $(this).contents().find("body").text();

Success response JSON is not work

JS:

var FBUpload = new Uploader({
    trigger: '#FBUpload',
    name: 'file',
    accept: 'image/*',
    action: '/index.php?m=index&c=bingfa&a=upload',
}).success(function(r) {
    console.log('r is: ' + r);
    console.log('code is: ' + r['code']);
});

Console:

r is: {"code":1,"msg":null,"response":{"name":"\u4ea7\u54c1\u8fd0\u8425.jpg","
image":"2\/2013\/08\/13\/34b88948e2192.jpg"},"ts":1376357267}

code is: undefined

贡献一个上传时动态增加表单参数方法

很多上传在刚开始的时候不能确定那些参数. 在上传的时候需要动态的添加参数
这里没有修改upload.js的源文件. 只是把 createInputs 提出来使用了下.

.change(function (files) {
                for (var i = 0; i < files.length; i++) {
                    console.log('you are selecting ' + files[i].name + ' Size: ' + files[i].size);
                }
                this.form.append(createInputs({'good':'hahdf'}));
                this.submit()
            }).success(function (response) {
                alert(response);
            });

jquery版本会影响uploadjs

我的环境
seajs 1.3.1
jquery 1.10.2
upload.js

我把下载的demo放到apache下面运行的,相应的路径我已经改过来了,运行的时候提示
image
,但是我把jquery换成1.7版本,就没有这个错误了

如何配置表单字段的编码

默认似乎是utf8,服务器是用gbk的,出现乱码。服务器编码不能改,是否能在upload插件里配置上传表单中字段的编码呢?

1.2.0版本依赖spm-jquery造成webpack打包时jquery代码冗余的问题

目前npm上的最新版本是1.2.0,其中package.json文件中声明的dependencies如下:
image

实际项目中依赖了jquery2.1.4,在webpack打包的时候,存在同时把jquery2.1.4和spm-jquery都打进去的情况,有点疑问:

  1. spm-jquery是否是原生的jquery1.7.2代码,有否做过改动?
  2. arale-upload是否支持jquery2.1.4?
  3. github上最新的package.json文件把dependencies依赖写到了spm对象中,理论上应该解决了webpack打包的这个问题,是否能够升级一个版本?
    4.如果短时间无法升级,是否有其他webpack config层面的解决方案?

无法隐藏

1.这个form能不能不基于body来决定定位,或者给ID也可以!有时候不需要显示的时候,想把它隐藏。现在的问题是,一直占用了一个位置在那里,点中的话就会打开上传框。

2.看到跟新日志说可以选择同一个文件,但是我试过,当连续选择同一个文件还是无法上传!

如果上传按钮在初始化之前是隐藏的,会出现触发选择文件按钮的高度问题

如果我的上传按钮最开始是隐藏的,outerHeight()只能得到按钮的border+padding的高度,在按钮展示以后,当鼠标移动到上传按钮,会执行一下代码:

// bind events
  Uploader.prototype.bind = function() {
    var self = this;
    var $trigger = $(self.settings.trigger);
    $trigger.mouseenter(function() {
      self.form.css({
        top: $trigger.offset().top,
        left: $trigger.offset().left,
        width: $trigger.outerWidth(),
        height: $trigger.outerHeight()
      });
    });
    self.bindInput();
  };

这里重新计算了form的高度,所以form高度不会出现问题,但是没有重新计算触发选择文件按钮的高度,导致按钮不容易点击到(高度太小),这个地方应该重新计算高度!

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.