使用的qiniu-js v3.3.3,图片压缩后上传,有用户反馈上传失败,日志code为400,message: file is not specified in multipart. 用多部真机调试,一直无法重现问题。
qiniu.compressImage(_file, options).then((data: any) => {
console.log(data)
const observable = qiniu.upload(
data.dist,
`${path + uuid.v4()}.${suffix}`,
bucketToken,
putExtra,
config
)
// const subscription = observable.subscribe({
observable.subscribe({
error: (err) => {
const err1 = Object.assign({ compresssize: data?.dist?.size }, err, {
_filename: _file.name,
_filesize: _file.size,
_filetype: _file.type
})
console.error('err:', err1)
resolve(err1)
},
complete: ({ hash, key }) => {
resolve({
domain,
hash,
key,
completeURL: domain + key
})
}
})
})
排查了好久,发现是uc浏览器不兼容,如果直接上传不压缩,uc可以上传成功
尝试提交工单问问呢
https://support.qiniu.com/tic...