使用putObject重定向的aws s3元标记

时间:2013-08-15 04:15:03

标签: php amazon-web-services amazon-s3

这是成功创建对象,但我在编写网站重定向的元标记时遇到问题。

有人有这个成功吗?

$result = $client->putObject(array(
    'Bucket' => $hello,
    'Key'    => $hellokey,
    'Body'   => 'the body',
    'ContentType' => 'text/html',
    'Metadata'   => array(
       'Website Redirect Location' => 'http://www.cnn.com/'
    )
));

1 个答案:

答案 0 :(得分:0)

根据API docs for putObject,您可能正在寻找WebsiteRedirectLocation参数。你为什么不试一试:

$result = $client->putObject(array(
    'Bucket' => $hello,
    'Key' => $hellokey,
    'Body' => 'the body',
    'ContentType' => 'text/html',
    'WebsiteRedirectLocation' => 'http://www.cnn.com/'
));