更改S3存储桶策略中特定文件扩展名的内容类型 [英] Change content-type in S3 bucket policy for a specific file extension

查看:125
本文介绍了更改S3存储桶策略中特定文件扩展名的内容类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,当我将属性列表文件(plist扩展名)放入S3存储桶时,由于某种原因,它将Content-type设置为application/octet-stream.当我在Objective-C(iOS)中下载它时会导致问题.

Currently when I place a property list file (plist extension) to a S3 bucket, it sets the Content-type to application/octet-stream for some reason. It causes issues when I download it in Objective-C (iOS).

如何更改存储桶策略,以使其自动将内容类型"设置为文本/纯文本"

How can change the bucket policy so it automatically sets the Content-type to text/plain

推荐答案

您不能.默认的内容类型是"application/octet-stream".

You cannot. The default content-type is "application/octet-stream".

请在以下AWS文档中找到相同的内容 http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html

Please find below the aws documentation for the same http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html

您唯一的选择是在上传时设置内容类型,或者在上传完成后对其进行更新.

The only option you have is setting the content-type at the time of upload or updating it once the upload is complete.

这篇关于更改S3存储桶策略中特定文件扩展名的内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆