我有一个在 GAE 上运行的 html 页面,我想用它来允许用户将文本文件从他们的计算机上传到我在 s3 上的存储桶。下面是代码:
----- HTML 代码-----
<!DOCTYPEhtml PUBLIC "-//W3C//DTDXHTML 1.0 transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-trnasitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>S3 POST Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="/static/def.css" rel="stylesheet" type="text/css"/>
<title> Upload Page </title>
</head>
<body>
<form action="https://mys3bucket.s3.amazonaws.com/" method="post" enctype="multipart/form-data">
<input type="hidden" name="key" value="uploads/${filename}">
<input type="hidden" name="AWSAccessKeyId" value="Put access key id here">
<input type="hidden" name="acl" value="public-read">
<input type="hidden" name="success_action_redirect" value="https://mys3bucket.s3.amazonaws.com/complete.htm">
<input type="hidden" name="policy" value="***---How do I calculate this?---***">
<input type="hidden" name="signature" value="***---How do I calculate this?---***">
<!-- Include any …Run Code Online (Sandbox Code Playgroud)