mirror of https://github.com/ElemeFE/element
upload: Increase support for Blob types
parent
6a5a3aaa2f
commit
06112e51da
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue