BeforeUpload: (up, file) => {
// 每个文件上传前,处理相关的事情
let nativeFile = file.getNative() // 获取file的源文件信息
let img = new Image()
img.src = URL.createObjectURL(nativeFile)
img.onload = function() {
let width = img.naturalWidth,
height = img.naturalHeight
console.log(width,height)
}
}
}
网友评论