-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Payload (413) too large when uploading large file #2072
Comments
What exactly do you want help with? If the payload is larger than the maximum configured payload size, the request fails, as it should. 🤷♂ |
@falbrechtskirchinger thanks for you reply. I modified the js in this way:
To send file in chunks. But again, the chunked encoding does not appear into the header:
Content length haeder is there. I see that library calls read_content_with_length() since len > 0:
But for some reason none of the requests (not really chunks) are routed. I end up with a lot of 404 on the client. With other servers I worked with there was the possibility to intercept the raw request and read the data as a stream in order to make partial writes to file. With this library I'm not sure how to do it. |
Ok. Starting to see the problem. The 404s are odd. I'll dig a little in the source and let you know what I find. Which version are you using?
#2073 should enable that as well. |
To help you debug the 404s, take a look at But this should all work … are you sure you don't have typo somewhere? |
@falbrechtskirchinger I finally nailed it. The final solution is to use multiple requests for each slice of file. For my 5MB max payload I see 1MB for each slice is the maximum to avoid errors. Said this, the issue with "bad request" was that the js was passing url query parameters, but the handler expected a plain /mypath/towebroot/, without any url parameters. So I changed the js to use Form data and finally it is working. Just for reference, here's the relevant part of the implementation: js:
Server side:
Thanks for the inspiration! |
Hello,
I noticed a potential problem when uploading large files (size >
set_payload_max_length
parameter). The client is a browser (Chrome) and I'm executing this js:On the server side, I registered a Post with ContentReader. It ends up doing this:
The content_reader callbacks are never called. And by looking at the sources, I see this branch is triggered, specifically in the part "StatusCode::PayloadTooLarge_413":
I tried to force the js to use chunked transfer encoding, but without any success as this is an option managed by browser. Also I tried to remove "content-length" header in order to trigger one of these two paths:
But again, no luck. Then I tried with curl:
But in this case i receive a different error (not found), even if the Post cleary registers the path "/ui/webroot". Here's the logs:
I'm running out of ideas :( Can anybody help?
Thanks
The text was updated successfully, but these errors were encountered: