I’ve two diferent file format in my project one is image type another one is csv type. For the image type, i want to set the 500 kB as limit and for CSV i want to set 8 mb as limit.
I’ve already set image size limit by using Plug.Parser
in the endpoint. So, it’s global now.
plug Plug.Parsers,
parsers: [:urlencoded, {:multipart, length: 500_000}, :json],
body_reader: {ApplicationWeb.Plugs.CacheBodyReader, :read_body, []},
pass: ["*/*"],
json_decoder: Phoenix.json_library()
Now, How can i handle this two file size limit ?