判断文件是否存在
本文介绍如何判断文件是否存在。
通过get接口判断文件是否存在:
client.get(object).then((result) => {
if (result.res.status == 200) {
return true
}
}).catch((e)=> {
if (e.code == 'NoSuchKey') {
return false
}
})
说明
get接口的更多应用,请参见下载文件。
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。
评论