I'm following this example: https://github.com/googleapis/nodejs-storage/blob/master/samples/generateV4SignedPolicy.js
My only changes were:
const bucketName = "gs://my-bucket.appspot.com/";
const filename = "test.jpg";
const { Storage } = require("@google-cloud/storage");
const storage = new Storage({
projectId: require("./key.json").project_id,
credentials: require("./key.json"),
});
Then I exported the output to a HTML file to test it:
node index.js > index.html
But when I submit the file, I receive:
<Error>
<Code>InvalidPolicyDocument</Code>
<Message>
The content of the form does not meet the conditions specified in the policy document.
</Message>
<Details>
Policy did not reference these fields: bucket submit
</Details>
</Error>
Is it a bug on the code example?
Do I need any configuration/permissions on my part?