upload: Increase support for Blob types

pull/7939/head
Div 2017-11-01 15:05:14 +08:00 committed by 杨奕
parent 6a5a3aaa2f
commit 06112e51da
1 changed files with 2 additions and 1 deletions

View File

@ -91,7 +91,8 @@ export default {
const before = this.beforeUpload(rawFile); const before = this.beforeUpload(rawFile);
if (before && before.then) { if (before && before.then) {
before.then(processedFile => { before.then(processedFile => {
if (Object.prototype.toString.call(processedFile) === '[object File]') { const fileType = Object.prototype.toString.call(processedFile);
if (fileType === '[object File]' || fileType === '[object Blob]') {
this.post(processedFile); this.post(processedFile);
} else { } else {
this.post(rawFile); this.post(rawFile);