阿里云 oss 文件不能下载 只能直接打开的解决方案

阿里云的oss,直接上传后,可以访问,直接是打开

有一些程序,需要直接能下载

设置oss文件的Content-Disposition属性值为attachment

就是直接打开了

但oss有很多文件,不能批量设置

现在可以用ossutil批量操作

=====

原理:

通过ossutil连接到oss,然后通过命令行,直接修改:Content-Disposition值为attachment

ossutil支持多系统

=====

步骤:

1:下载工具
https://help.aliyun.com/document_detail/50452.html?spm=a2c4g.11186623.6.1087.tC0fcy


2:配置文件
ossutil64 config


3:执行命令

测试命令:
ossutil64 ls

完整命令:

ossutil64 set-meta oss://wenjian/ Content-Disposition:attachment --update -r

=====

具体参考:

https://help.aliyun.com/document_detail/50452.html?spm=a2c4g.11186623.6.1087.q3UeEs

你可能感兴趣的:(服务器)