基于浏览器上传到Amazon S3? [英] Browser Based Uploads to Amazon S3?
问题描述
<一个href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?UsingHTTPPOST.html">Amazon对如何编写一个格式指令的帖子直接通过HTML POST Amazon的S3服务。 但是,他们没有关于如何创建一个简单的表格,直接上传到S3存储,以及永不放弃一个实际的例子HTML文件很清楚......
Amazon has instructions on how to write a form that posts directly to Amazon's S3 service via HTML POST. However, they are not very clear on how to create a simple form to upload directly to an S3 bucket, and never give an actual example html file...
有一个很好的例子可以,我可以查看示例code?
Is there a good example available where I can view the sample code?
推荐答案
下面是一段HTML code从上述文档。我认为这是自我解释,但让我知道,如果你有任何麻烦。
Here is a piece of html code from the aforementioned doc. I think it's self explanatory but let me know if you're having any troubles.
<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" />
这篇关于基于浏览器上传到Amazon S3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!