7
8

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 5 years have passed since last update.

Ruby で Amazon S3 にアップロードするときのアクセス権限 (aws-s3用)

Last updated at Posted at 2014-04-17

#アクセス権限の種類は4つあるよ

  1. private (default です)
  2. public_read
  3. public_read_write
  4. authenticated_read

public_read_write の使い道は良くわからん。誰でも PUT で書き込みできるようにするそうな。ウェブサイトの画像等のストレージに使用するのなら、public_read にする必要あり。デフォルトは private なので、とりあえず保存したら他の人は読めません。

S3Object.store(
    'kiss.jpg',
    data,
    'marcel',
    :access => :public_read
  )

のように書くと、 http://s3.amazonaws.com/marcel/kiss.jpg から読めるようになる。 marcel は backet の名前です。

7
8
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
7
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?