OSS has OSSAccessKeyId url upload pictures and Signature, visit OSS url automatically download pictures

After using OSS Ali cloud upload pictures, access to the url and always with a suffix OSSAccessKeyId Signature, words can not access removed
Solution:
ObjectMetadata objectMetadata = new ObjectMetadata();
objectMetadata.setObjectAcl(CannedAccessControlList.PublicRead);
Add objectMetadata parameters again in ossClient.putObject
Picture upload again call interface intercepts url access
url.substring(0, url.indexOf("?"))
As for access to automatically download pictures url, only need to add the following contemtType just fine
objectMetadata.setContentType("image/jpg");

Guess you like

Origin www.cnblogs.com/gqymy/p/12554081.html