I have an HTML form with a file field that is used to upload a file to a /file
route in my Phoenix application.
I mimic this behaviour from command line with curl -v -F "file=@MyTestFile" http://localhost:4000/file/
for faster testing.
When I use a big file (turning point seems to be around 7.7MB), I get the following exception from Plug:
18:40:38.897 [error] Error in process <0.420.0> with exit value: {[{reason,#{'exception'=>true,'struct'=>'Elixir.Plug.Parsers.RequestTooLargeError',message=>nil}},{mfa,{'Elixir.Plug.Adapters.Cowboy.Handler',init,3}},{stacktrace,[{'Elixir.Plug.Parsers',reduce,6,[{file,"lib/plug...
Is there a workaround to allow bigger files to be uploaded?
There seems to be a :length
option keyword in Plug, but how could I set it from Phoenix? And what is the reason this particular value of 8_000_000
has been chosen?