- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 46 for upload_files (0.07 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs/en/docs/reference/uploadfile.md
# `UploadFile` class You can define *path operation function* parameters to be of the type `UploadFile` to receive files from the request. You can import it directly from `fastapi`: ```python from fastapi import UploadFile ``` ::: fastapi.UploadFile options: members: - file - filename - size - headers - content_type - readCreated: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 472 bytes - Click Count (0) -
docs_src/request_files/tutorial003_an_py39.py
from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse app = FastAPI() @app.post("/files/") async def create_files( files: Annotated[list[bytes], File(description="Multiple files as bytes")], ): return {"file_sizes": [len(file) for file in files]} @app.post("/uploadfiles/") async def create_upload_files( files: Annotated[
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 952 bytes - Click Count (0) -
tests/test_tutorial/test_request_files/test_tutorial003.py
path2 = tmp_path / "test2.txt" path2.write_bytes(b"<file content2>") client = TestClient(app) with path.open("rb") as file, path2.open("rb") as file2: response = client.post( "/uploadfiles/", files=( ("files", ("test.txt", file)), ("files", ("test2.txt", file2)), ), ) assert response.status_code == 200, response.text
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 7.5K bytes - Click Count (0) -
fastapi/datastructures.py
from starlette.datastructures import UploadFile as StarletteUploadFile class UploadFile(StarletteUploadFile): """ A file uploaded in a request. Define it as a *path operation function* (or dependency) parameter. If you are using a regular `def` function, you can use the `upload_file.file` attribute to access the raw standard Python file (blocking, not async), useful andCreated: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 5.1K bytes - Click Count (0) -
src/main/webapp/WEB-INF/view/admin/storage/admin_storage.jsp
key="labels.storage_file"/></label> <div class="form-inline col-sm-9"> <input type="file" name="uploadFile" id="uploadFile" class="form-control-file"/>
Created: Sat Dec 20 09:19:18 GMT 2025 - Last Modified: Thu Nov 13 05:54:52 GMT 2025 - 20.7K bytes - Click Count (0) -
docs/de/docs/tutorial/request-files.md
Aber es gibt viele Fälle, in denen Sie davon profitieren, `UploadFile` zu verwenden. ## Datei-Parameter mit `UploadFile` { #file-parameters-with-uploadfile } Definieren Sie einen Datei-Parameter mit dem Typ `UploadFile`: {* ../../docs_src/request_files/tutorial001_an_py39.py hl[14] *} `UploadFile` zu verwenden, hat mehrere Vorzüge gegenüber `bytes`:Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Sep 20 15:10:09 GMT 2025 - 8.7K bytes - Click Count (0) -
docs/uk/docs/tutorial/request-files.md
Але в деяких випадках Вам може знадобитися `UploadFile`. ## Параметри файлу з `UploadFile` Визначте параметр файлу з типом `UploadFile`: {* ../../docs_src/request_files/tutorial001_an_py39.py hl[14] *} Використання `UploadFile` має кілька переваг перед `bytes`: * Вам не потрібно використовувати `File()` у значенні за замовчуванням параметра.Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Feb 22 22:01:44 GMT 2025 - 11.2K bytes - Click Count (0) -
tests/test_request_params/test_file/test_optional.py
return {"file_size": len(p) if p else None} @app.post("/optional-uploadfile", operation_id="optional_uploadfile") async def read_optional_uploadfile(p: Annotated[Optional[UploadFile], File()] = None): return {"file_size": p.size if p else None} @pytest.mark.parametrize( "path", [ "/optional-bytes", "/optional-uploadfile", ], ) def test_optional_schema(path: str):Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 9.7K bytes - Click Count (0) -
tests/test_request_params/test_file/test_list.py
@app.post("/list-uploadfile", operation_id="list_uploadfile") async def read_list_uploadfile(p: Annotated[list[UploadFile], File()]): return {"file_size": [file.size for file in p]} @pytest.mark.parametrize( "path", [ "/list-bytes", "/list-uploadfile", ], ) def test_list_schema(path: str): openapi = app.openapi()
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:31:34 GMT 2025 - 11.2K bytes - Click Count (0) -
tests/test_request_params/test_file/test_required.py
@app.post("/required-uploadfile", operation_id="required_uploadfile") async def read_required_uploadfile(p: Annotated[UploadFile, File()]): return {"file_size": p.size} @pytest.mark.parametrize( "path", [ "/required-bytes", "/required-uploadfile", ], ) def test_required_schema(path: str): openapi = app.openapi() body_model_name = get_body_model_name(openapi, path)
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 10.8K bytes - Click Count (0)