소스 검색

[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