Skip to content

Commit 3396f0c

Browse files
authored
fix(File): add default blob.name (#431)
if name not set and the file is large, qiniu will respond with "invalid multipart format: multipart: message too large" error.
1 parent 102b27a commit 3396f0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/file.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ module.exports = function(AV) {
129129
var dataBase64 = parseBase64(data.base64, mimeType);
130130
this._source = Promise.resolve({ data: dataBase64, type: mimeType });
131131
} else if (data && data.blob) {
132-
if (!data.blob.type) {
132+
if (!data.blob.type && mimeType) {
133133
data.blob.type = mimeType;
134134
}
135+
if (!data.blob.name) {
136+
data.blob.name = name;
137+
}
135138
if (process.env.CLIENT_PLATFORM === 'ReactNative' || process.env.CLIENT_PLATFORM === 'Weapp') {
136139
this._extName = extname(data.blob.uri);
137140
}

0 commit comments

Comments
 (0)