Specify Content-Type in AWS PHP's upload function

前端 未结 2 666
再見小時候
再見小時候 2021-01-06 08:31

I am migrating my code from AWS PHP SDK1 to SDK2 (https://github.com/aws/aws-sdk-php).

I have an image uploader. In my previous version, I would specify the Content-

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-06 09:23

    1. Well, using AWS\S3\S3Client::putObject() directly would definitely give you the control you need.

    2. File extensions need to be lowercase for the automatic detection to work.

    3. You can find the list of supported mime types in Guzzle\Http\Mimetypes.

提交回复
热议问题