فهرست منبع

[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