3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

S3に画像をアップロードしようとしたら、Client error: `PUT https://~~~~~~.s3.ap-northeast-1.amazonaws.com/WHdo4kayM4bV.png` resulted in a `400 Bad Request`というエラーが発生した

Last updated at Posted at 2022-03-21

S3に画像がアップロードできない

先日S3に画像をアップロードしようとしたら以下のようなエラーが発生した

laravel.log
Client error: `PUT https://~~~~~~.s3.ap-northeast-1.amazonaws.com/WHdo4kayM4bV.png` resulted in a `400 Bad Request` response:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessControlListNotSupported</Code><Message>The bucket does not all (truncated...)
 AccessControlListNotSupported (client): The bucket does not allow ACLs - <?xml version="1.0" encoding="UTF-8"?>

「The bucket does not allow ACLs」とあるので、S3のアクセスコントロール設定を見直してみることにした。

解決策

結論、以下の流れで解決できました。

S3 > バケット選択 > アクセス許可 > オブジェクト所有者のACL設定を無効から有効へ変更 > 変更の保存

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?