janareit's avatar

How to set file storage class for AWS S3

How can I set storage class when I upload image to Amazon S3 drive?

I have tried

        Storage::disk('s3')->put($gallery->path.$imageName, $content, 'public', [
            'storageClass' => 'STANDARD_IA'
        ]);

but it still uploads file as STANDARD storage class...

0 likes
1 reply
janareit's avatar
janareit
OP
Best Answer
Level 4

I resolved it myself and skipped setting storageClass when uploading. Instead I implemented Lifecycle rule for moving objects automatically to STANDARD_IA storage calss. Case closed.

Please or to participate in this conversation.