-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
413 PAYLOAD_TOO_LARGE using a pre-signed URL #2200
Comments
I see that you used The put object API accepts only PUT requests: There are a few APIs that accept POST requests, S3Mock will try to best match the incoming request to a matching API given the parameters and the HTTP method of the request, so we can't return a good error message here. |
@afranken thanks for your reply. Ok, so it looks like a production S3 endpoint should accept a POST with a form to create an object. The presigned_post URL is a bit different than a typical pre-signed URL generated through the aws-sdk because the URL itself is just the bucket address, the body of the request includes further form data (acl, Content-Type) and you can also attach conditions (e.g. content-length-range) It might be worthwhile taking a look at potentially adding this functionality. While the Java aws-sdk doesn't generate this type of presigned URL (yet?), packages for other languages, e.g. for Python, Javascript, Ruby, and perhaps others, do. The POST form method of creating an object has the benefit that it's a lot more flexible, allowing you to create complex rules for Content-Type, specifying file size requirements, etc. |
ah, I wasn't aware that there is a separate API for browser uploads that specifies a POST Object: It should be possible to support this, but I'm currently working on versioning support, so this may take some time. |
Hi,
I'm getting a 413 when trying to upload an image of 1.9 MB to S3Mock using a pre-signed URL.
When I try to upload the same photo using the aws-sdk it works fine.
But when I try to use the pre-signed URL I'm getting a 413.
Container logging:
Has anyone encountered this before?
Pre-signed URL was generated with the following arguments (using boto3 but the arguments should be the same as in Java):
The text was updated successfully, but these errors were encountered: