Amazon有关于如何编写通过 HTML POST 直接发布到 Amazon 的 S3 服务的表单的说明。 但是,他们不是很清楚如何创建一个简单的表单来直接上传到 S3 存储桶,并且从未给出实际的示例 html 文件...
是否有一个很好的示例可供我查看示例代码?
最佳答案
这是来自上述文档的一段 html 代码。我认为这是不言自明的,但如果您遇到任何问题,请告诉我。
<form action="http://johnsmith.s3.amazonaws.com/" method="post" enctype="multipart/form-data">
Key to upload: <input type="input" name="key" value="user/eric/" /><br />
<input type="hidden" name="acl" value="public-read" />
<input type="hidden" name="success_action_redirect" value="http://johnsmith.s3.amazonaws.com/successful_upload.html" />
Content-Type: <input type="input" name="Content-Type" value="image/jpeg" /><br />
<input type="hidden" name="x-amz-meta-uuid" value="14365123651274" />
Tags for File: <input type="input" name="x-amz-meta-tag" value="" /><br />
<input type="hidden" name="AWSAccessKeyId" value="15B4D3461F177624206A" />
<input type="hidden" name="Policy" value="POLICY" />
<input type="hidden" name="Signature" value="SIGNATURE" />
File: <input type="file" name="file" /> <br />
<!-- The elements after this will be ignored -->
<input type="submit" name="submit" value="Upload to Amazon S3" />
关于html - 基于浏览器的上传到 Amazon S3?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1236688/