3

我试过:

$objS3->putObject(array(
    'Bucket'     => $sBucket
    'Key'        => $sBucketFolder . $sFilenameToSave,
    'SourceFile' => $sFile,
    'ACL'        => 'public-read'
    'Metadata'   => [
        'Content-Type'      => 'text/css',
        'Content-Encoding'  => 'gzip', 
    ]
));

但它没有用。任何的想法?

谢了。

4

1 回答 1

4

ContentType并且ContentEncoding不应作为元数据发送。改用这个:

$objS3->putObject(array(
    'Bucket'          => $sBucket
    'Key'             => $sBucketFolder . $sFilenameToSave,
    'SourceFile'      => $sFile,
    'ACL'             => 'public-read',
    'ContentType'     => 'text/css',
    'ContentEncoding' => 'gzip'
));
于 2013-09-08T10:52:21.257 回答