Skip to content

Commit c34de5c

Browse files
committed
fix(File): add metaData.size if available in browser (#366)
Conflicts: src/file.js
1 parent 771a121 commit c34de5c

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
@@ -352,6 +352,9 @@ module.exports = function(AV) {
352352
}
353353
this._source = Promise.resolve({ data: data.blob, type: guessedType });
354354
} else if (typeof File !== "undefined" && data instanceof global.File) {
355+
if (data.size) {
356+
this.attributes.metaData.size = data.size;
357+
}
355358
this._source = Promise.resolve({ data, type: guessedType });
356359
} else if (typeof global.Buffer !== "undefined" && global.Buffer.isBuffer(data)) {
357360
// use global.Buffer to prevent browserify pack Buffer module

0 commit comments

Comments
 (0)