I'm developing a VERY simple Web-App with Google-App-Engine Plugin for Eclipse. I've just written this snippet of code in HTML of my "home.html".
Here home.html is:
<!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>
This is a very simple Form without any kind of Authorization or whatever.. For Info, you could see this: https://developers.google.com/storage/docs/reference-methods#postobject (that i've already memorized).
I have had different Response Error from Google (in XML Format) like:
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>
Can anyone help me to fill in this form, please?
To be more specific: It works with this form:
<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>
The fileUploadingName is for example: sample.txt
but the problem persists because i need to fiil the correct "key" that is the name of the file that i'm going to Upload. How can i fix it?