fastapi/docs_src/request_files
brunofoggiatto 9894481f3c 📝 Add file upload validation and saving examples
This PR adds practical examples for validating and saving uploaded files,
addressing common production use cases.

New examples:
- Tutorial 004: Upload with validation (file type, size, count)
- Tutorial 005: Saving files to disk with unique names

Each example includes variants for Python 3.9+ and 3.10+.

Documentation updated with new sections explaining validation
best practices and file saving security considerations.
2025-11-10 10:27:47 -03:00
..
tutorial001.py Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906) 2022-05-13 18:38:22 -05:00
tutorial001_02.py 📝 Add docs recommending `Union` over `Optional` and migrate source examples (#4908) 2022-05-14 06:59:59 -05:00
tutorial001_02_an.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial001_02_an_py39.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial001_02_an_py310.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial001_02_py310.py Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906) 2022-05-13 18:38:22 -05:00
tutorial001_03.py Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906) 2022-05-13 18:38:22 -05:00
tutorial001_03_an.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial001_03_an_py39.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial001_an.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial001_an_py39.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial002.py Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906) 2022-05-13 18:38:22 -05:00
tutorial002_an.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial002_an_py39.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial002_py39.py Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906) 2022-05-13 18:38:22 -05:00
tutorial003.py Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906) 2022-05-13 18:38:22 -05:00
tutorial003_an.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial003_an_py39.py 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests (#9268) 2023-03-18 13:29:59 +01:00
tutorial003_py39.py Add support for not needing `...` as default value in required Query(), Path(), Header(), etc. (#4906) 2022-05-13 18:38:22 -05:00
tutorial004.py 📝 Add file upload validation and saving examples 2025-11-10 10:27:47 -03:00
tutorial004_an_py39.py 📝 Add file upload validation and saving examples 2025-11-10 10:27:47 -03:00
tutorial004_an_py310.py 📝 Add file upload validation and saving examples 2025-11-10 10:27:47 -03:00
tutorial005.py 📝 Add file upload validation and saving examples 2025-11-10 10:27:47 -03:00
tutorial005_an_py39.py 📝 Add file upload validation and saving examples 2025-11-10 10:27:47 -03:00
tutorial005_an_py310.py 📝 Add file upload validation and saving examples 2025-11-10 10:27:47 -03:00