Skip to content

Commit e52afb6

Browse files
committed
fix: TypeError of FormData.append
TypeError: Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'.
1 parent 0506888 commit e52afb6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rc-upload",
3-
"version": "3.0.2",
3+
"version": "3.0.3",
44
"description": "upload ui component for react",
55
"keywords": [
66
"react",

src/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default function upload(option) {
6262
});
6363
}
6464

65-
formData.append(option.filename, option.file, option.file && option.file.name);
65+
formData.append(option.filename, option.file, option.file instanceof Blob && option.file.name);
6666

6767
xhr.onerror = function error(e) {
6868
option.onError(e);

0 commit comments

Comments
 (0)