浏览代码

[frontend] fix to upload files with non ascii names on macos (#2888)

Uploading a file via the web browser on MacOS will use the NFD unicode normalization (decomposed) for the filename which will cause the upload to HDFS to fail.
By normalizing the file name to NFC (composed) before sending it from the client we can avaoid this problem.

Co-authored-by: Björn Alm <balm@cloudera.com>
Bjorn Alm 3 年之前
父节点
当前提交
c07f5830aa
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      desktop/core/src/desktop/js/ext/fileuploader.custom.js

+ 2 - 2
desktop/core/src/desktop/js/ext/fileuploader.custom.js

@@ -1256,8 +1256,8 @@ qq.extend(qq.UploadHandlerXhr.prototype, {
             }
         };
 
-        var formData = new FormData();
-        formData.append(params.fileFieldLabel, file);
+        var formData = new FormData();        
+        formData.append(params.fileFieldLabel, file, file.name.normalize('NFC'));
         formData.append('dest', params.dest);
 
         // Encoding is needed to support folder names with some special