Skip to content

Commit b22db2c

Browse files
leeyehaisk
authored andcommitted
fix(File): add metaData.size if available in browser (#366)
1 parent 37bc145 commit b22db2c

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
@@ -391,6 +391,9 @@ module.exports = function(AV) {
391391
}
392392
this._source = AV.Promise.as(data.blob, guessedType);
393393
} else if (typeof File !== "undefined" && data instanceof global.File) {
394+
if (data.size) {
395+
this.attributes.metaData.size = data.size;
396+
}
394397
this._source = AV.Promise.as(data, guessedType);
395398
} else if (typeof global.Buffer !== "undefined" && global.Buffer.isBuffer(data)) {
396399
// use global.Buffer to prevent browserify pack Buffer module

0 commit comments

Comments
 (0)