Need example how to use max_files=n and max_fields=n #2848
-
Hello everyone, I came across page, which states that, if necessary, you can increase the limit by affecting the max_files and max_fields parameters, but there is no example of how to do this. For example, there is a method: @app.post("/images")
async def upload_images(
field_0: Annotated[str, Body(...)],
...
field_k: Annotated[str, Body(...)],
images: Annotated[List[UploadFile], File()]): How can I influence the max_files and max_fields parameters here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The page that you link to describes arguments of Unless I am mistaken, the sample code that you are giving here uses |
Beta Was this translation helpful? Give feedback.
The page that you link to describes arguments of
starlette
'sRequest.form
method.Unless I am mistaken, the sample code that you are giving here uses
FastAPI
's system for reading request data. You should ask the people there for how to work with potential limits of number of files/parameters in multipart forms, e.g. on the FastAPI GitHub discussions page.