默认我们通过sdk生成的txt/html/htm等文本文件的http链接是自动打开而不是下载。
通过如下方式即可解决:
const url = store.signatureUrl('ossdemo.txt', { expires: 3600, response: { 'content-disposition': 'attachment; filename="'+ filename +'"' } }); console.log(url);
主要是通过Content-Disposition指定attachment来强制下载。