Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsed File shape is incorrect on certain platforms #333

Open
paul-vd opened this issue Jun 22, 2021 · 1 comment
Open

Parsed File shape is incorrect on certain platforms #333

paul-vd opened this issue Jun 22, 2021 · 1 comment

Comments

@paul-vd
Copy link

paul-vd commented Jun 22, 2021

After debugging a cordova instance of a web app, we ran into an issue with the file uploader, we found the error to be in the AjaxUploader.tsx

Here is the patch that we had to apply to fix the issue:

diff --git a/node_modules/rc-upload/es/AjaxUploader.js b/node_modules/rc-upload/es/AjaxUploader.js
index 34509ce..2d5a577 100644
--- a/node_modules/rc-upload/es/AjaxUploader.js
+++ b/node_modules/rc-upload/es/AjaxUploader.js
@@ -219,13 +219,15 @@ var AjaxUploader = /*#__PURE__*/function (_Component) {
                 // Not sure if this will work since no related test case works with it
                 (_typeof(transformedFile) === 'object' || typeof transformedFile === 'string') && transformedFile ? transformedFile : file;
 
-                if (parsedData instanceof File) {
-                  parsedFile = parsedData;
-                } else {
-                  parsedFile = new File([parsedData], file.name, {
-                    type: file.type
-                  });
-                }
+                parsedFile = parsedData;
+
+                // if (parsedData instanceof File) {
+                //   parsedFile = parsedData;
+                // } else {
+                //   parsedFile = new File([parsedData], file.name, {
+                //     type: file.type
+                //   });
+                // }
 
                 mergedParsedFile = parsedFile;
                 mergedParsedFile.uid = file.uid;

Screenshots

Here is the debug point that triggered the parsed file change:

image

The mergedParsedFile's name becomes a [File] and the reset of the object is malformated:

image

Setup

antd: v4.16.2
Platform: Android 8.1
Cordova: v10
Cordova Android: v9

@hank619
Copy link

hank619 commented Jun 23, 2022

Any plan to fix this? Meet the same issue on RedMi 10C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants