瀏覽代碼

Fix cannot set formdata to 'undefined'

Maks3w 10 年之前
父節點
當前提交
a180d53d79
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      js/fileinput.js

+ 2 - 2
js/fileinput.js

@@ -869,11 +869,11 @@
             return xhrobj;
             return xhrobj;
         },
         },
         upload: function(i, files) {
         upload: function(i, files) {
-            self.formdata = new FormData();
-            var self = this, total = files.length, formdata = self.formdata, 
+            var self = this, total = files.length, formdata = new FormData(),
                 previewId = self.previewInitId + "-" + i, $thumb = $('#' + previewId), 
                 previewId = self.previewInitId + "-" + i, $thumb = $('#' + previewId), 
                 $btnUpload = $thumb.find('.kv-file-upload'), $btnDelete = $thumb.find('.kv-file-remove'),
                 $btnUpload = $thumb.find('.kv-file-upload'), $btnDelete = $thumb.find('.kv-file-remove'),
                 $indicator = $thumb.find('.file-upload-indicator'), config = self.fileActionSettings;
                 $indicator = $thumb.find('.file-upload-indicator'), config = self.fileActionSettings;
+            self.formdata = formdata;
             if (total == 0) {
             if (total == 0) {
                 return;
                 return;
             }
             }