【发布时间】:2010-11-26 00:17:27
【问题描述】:
我需要使用 Amazon S3 上传给定图像
我有这个 PHP:
<?
$uploaddir = 'images/';
$file = basename($_FILES['userfile']['name']);
$uploadfile = $uploaddir . $file;
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "Data Uploaded Successfully";
} else {
echo "ERROR";
}
?>
但它给了我这个错误:
<?xml version="1.0" encoding="UTF-8" ?>
<Error>
<Code>MethodNotAllowe</Code>
<Message>The specified method is not allowed against this resource.</Message>
<ResourceType>OBJECT</ResourceType>
<Method>POST</Method>
....
<AllowedMethod>PUT</AllowedMethod>
....
</Error>
如何上传文件?
【问题讨论】:
标签: php amazon-s3 amazon-web-services