在Amazon S3中禁用cookie,可以通过以下方法实现:
x-amz-meta-s3-disable-cookie: true
。PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, key, file);
ObjectMetadata metadata = new ObjectMetadata();
metadata.addUserMetadata("x-amz-meta-s3-disable-cookie", "true");
putObjectRequest.setMetadata(metadata);
s3Client.putObject(putObjectRequest);metadata = {"x-amz-meta-s3-disable-cookie": "true"}
s3_client.put_object(Bucket=bucket_name, Key=key, Body=file, Metadata=metadata)const params = {
Bucket: bucketName,
Key: key,
Body: file,
Metadata: {
"x-amz-meta-s3-disable-cookie": "true"
}
};
s3.putObject(params, function(error, data) {
if (error) {
console.log(error);
} else {
console.log("Successfully uploaded object to Amazon S3");
}
});通过以上方法,可以在Amazon S3中禁用cookie。x-amz-meta-s3-disable-cookie
的元数据,并将其值设置为true
。领取专属 10元无门槛券
手把手带您无忧上云