我收到标题中指定的错误。
我尝试这样做:使用php上传带有签名 URL 的对象
问题如下:['starts-with', '$key', 'test/']
['starts-with', '$key', 'test/']这是如何运作的?
存储桶中存在测试文件夹。
请帮忙。
我的代码(服务器端 php):
$formInputs = ['acl' => 'private'];
// Construct an array of conditions for policy $options = [
['acl' => 'private'],
['bucket' => $bucket],
['starts-with', '$key', 'test/'] ];
// Optional: configure expiration time string $expires = '+2 hours';
$postObject = new \Aws\S3\PostObjectV4(
$client,
$bucket,
$formInputs,
$options,
$expires );
$formAttributes = $postObject->getFormAttributes(); $formInputs = $postObject->getFormInputs();
?>
----------
<form action="<?=$formAttributes['action']?>" method="<?=$formAttributes['method']?>" enctype="<?=$formAttributes['enctype']?>">
<?php
foreach($formInputs as $k=>$v){
echo'<input …Run Code Online (Sandbox Code Playgroud)