@Fox said in Upload image via multipart/form-data:
Use the constructor
Tried it, its not sending the full request somehow, here is the constructed request:
"x-amz-date",[[AMZ_DATE]],"x-amz-credential",[[AMZ_CRED]],"x-amz-algorithm",[[AMZ_ALGO]],"x-amz-signature",[[AMZ_SEG]],"Content-Type","image/jpeg","policy",[[AMZ_POLICY]],"x-amz-meta-user-id",[[AMZ_UID]],"key",[[AMZ_KEY]],"acl","public-read","file","base64://" + [[BASE64]]
Full post request from the HTTP Sniffer:
Content-Type: multipart/form-data; boundary=nlhmpcbxogehtvgecwbtlpmodwklktxbykkxobzj
Accept: */*
--nlhmpcbxogehtvgecwbtlpmodwklktxbykkxobzj
Content-Disposition: form-data; name="x-amz-date";
20231107T133536Z
--nlhmpcbxogehtvgecwbtlpmodwklktxbykkxobzj
Content-Disposition: form-data; name="x-amz-algorithm";
AWS4-HMAC-SHA256
--nlhmpcbxogehtvgecwbtlpmodwklktxbykkxobzj
Content-Disposition: form-data; name="file"; filename="file.jpg"
Content-Type: image/jpeg
�PNG
Response:
<Error><Code>InvalidArgument</Code><Message>Bucket POST must contain a field named 'key'. If it is specified, please check the order of the fields.</Message><ArgumentName>key</ArgumentName><ArgumentValue></ArgumentValue><RequestId>CHQ6WT90FB9XJ6X0</RequestId><HostId>mHsNNdpEvGeU7iU5HO7FQoNTwC8gwCklmMaE3Ap7sm1Z0BG7kr6fF9LsMiryRYFwwg6SJ+OYJbfIlE1DuErT08tNHt9u7OJZ</HostId></Error>
Any idea why this happens?
Thanks