浏览代码

Web Server: Fix undefined values for some browsers

Microsoft browsers could send undefined path with flat structures where
other browsers could send empty strings.
Edgar Fouillet 5 年之前
父节点
当前提交
6f51926059
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Resources/web/jquery.fileupload.js

+ 3 - 3
Resources/web/jquery.fileupload.js

@@ -419,15 +419,15 @@
                         formData.append(paramName, options.blob, file.name);
                     } else {
                         $.each(options.files, function (index, file) {
+                            var filepath = file.relativePath !== undefined ? file.relativePath : "";
+                            filepath += file.name !== undefined ? file.name : "";
                             // This check allows the tests to run with
                             // dummy objects:
                             if (that._isInstanceOf('File', file) ||
                                     that._isInstanceOf('Blob', file)) {
                                 formData.append(
                                     options.paramName[index] || paramName,
-                                    //file.relativePath + file.name will handle both Chrome and Firefox
-                                    //behaviours with filenames whereas file.path will only work with Firefox.
-                                    file, file.relativePath + file.name
+                                    file, filepath
                                 );
                             }
                         });