Hi, how can i upload large file? it throws Plug.Parsers.RequestTooLargeError
even though i added length in Plug.Parsers
.
# endpoint.ex
plug Plug.Parsers,
parsers: [
:urlencoded,
{:multipart, length: 100_000_000},
:json
],
length: 100_000_000,
pass: ["*/*"],
json_decoder: Phoenix.json_library()
My heex template form has multipart
and file_input/3
has multiple attribute
. I’m uploading 3 files, no larger than 5mb each and it throws this:
Plug.Parsers.RequestTooLargeError at POST /upload
the request is too large. If you are willing to process larger requests, please give a :length to Plug.Parsers
lib/plug/parsers.ex
350
351 {:next, conn} ->
352 reduce(conn, rest, type, subtype, params, pass, query_string_length, validate_utf8)
353
354 {:error, :too_large, _conn} ->
355 raise RequestTooLargeError
356 end
357 end
358
359 defp reduce(conn, [], type, subtype, _params, pass, query_string_length, validate_utf8) do
360 if accepted_mime?(type, subtype, pass) do
Tried also uploading a single file that’s 20mb and still throws the same error. What did i miss?