Skip to content

Commit 4f52349

Browse files
committed
Merge pull request #261 from leeyeh/rn-android-file
fix(File): fix empty file issue on React Native Android
2 parents c3406ef + 2555615 commit 4f52349

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/file.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ module.exports = function(AV) {
379379
this.attributes.base64 = dataURLToBase64(data.base64);
380380
this._source = AV.Promise.as(dataBase64, guessedType);
381381
} else if (data && data.blob) {
382+
if (!data.blob.type) {
383+
data.blob.type = guessedType;
384+
}
382385
this._source = AV.Promise.as(data.blob, guessedType);
383386
} else if (typeof(File) !== "undefined" && data instanceof global.File) {
384387
this._source = AV.Promise.as(data, guessedType);

0 commit comments

Comments
 (0)