我开发一个非常简单的web应用程序与谷歌 - 应用程序引擎Eclipse插件。 我刚刚写这段程式码,在我的“/home.html”的HTML的。
这里home.html的是:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Insert title here</title>
</head>
<body>
<form action="http://storage.googleapis.com/myBucketName" method="post" name="putFile" id="putFile"
enctype="multipart/form-data">
<input type="hidden" name="key" value="I don't know what is going here because i cannot guess which file i will upload" />
<input type="hidden" name="success_action_status" value="201" />
<input type="file" name="file" id="file">
<input type="submit" value="Upload">
</form>
</body>
</html>
这是一个没有任何授权或什么的。对于一个信息非常简单的形式,你可以看到这一点: https://developers.google.com/storage/docs/reference-methods#postobject (我已经记住) 。
我有不同的响应错误从谷歌(以XML格式),如:
1)
<Error>
<Code>InvalidArgument</Code>
<Message>Invalid argument.</Message>
<Details>Missing file part</Details>
</Error>
2)
<Error>
<Code>InvalidArgument</Code>
<Message>Invalid argument.</Message>
<Details>Cannot create buckets using a POST.</Details>
</Error>
3)
<Error>
<Code>InvalidArgument</Code>
<Message>Invalid argument.</Message>
<Details>
Invalid query parameter(s): [file, success_action_status, key]
</Details>
</Error>
谁能帮我填写这张表格,好吗?
更具体地讲:它适用于这种形式:
<form action="http://storage.googleapis.com/bucketName" method="post" name="putFile" id="putFile"
enctype="multipart/form-data">
<input type="hidden" name="bucket" value="bucketName">
<input type="hidden" name="key" value="fileUploadingName" />
<input type="hidden" name="success_action_status" value="201" />
<input type="file" name="file">
<input type="submit" value="Upload">
</form>
该fileUploadingName是例如:sample.txt的
但问题仍然存在,因为我需要fiil正确的“钥匙”是,我要上传的文件的名称。 我该如何解决呢?