- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 73 for upload_file (0.12 sec)
-
docs/en/docs/tutorial/request-files.md
But there are several cases in which you might benefit from using `UploadFile`. ## File Parameters with `UploadFile` Define a file parameter with a type of `UploadFile`: //// tab | Python 3.9+ ```Python hl_lines="14" {!> ../../docs_src/request_files/tutorial001_an_py39.py!} ``` ////
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 10.2K bytes - Viewed (0) -
docs/em/docs/tutorial/request-files.md
โ๏ธ ๐คฏ ๐ ๐ โ ๐ ๐ ๐ ๐ ๐ช ๐พ. ๐ ๐ ๐ท ๐ ๐คช ๐. โ๏ธ ๐ค ๐ ๐ผ โ ๐ ๐ช ๐ฐ โช๏ธโก๏ธ โ๏ธ `UploadFile`. ## ๐ ๐ข โฎ๏ธ `UploadFile` ๐ฌ ๐ ๐ข โฎ๏ธ ๐ `UploadFile`: ```Python hl_lines="12" {!../../docs_src/request_files/tutorial001.py!} ``` โ๏ธ `UploadFile` โ๏ธ ๐ ๐ ๐คญ `bytes`: * ๐ ๐ซ โ๏ธ โ๏ธ `File()` ๐ข ๐ฒ ๐ข. * โซ๏ธ โ๏ธ "๐งต" ๐:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 6.6K bytes - Viewed (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` Definieren Sie einen Datei-Parameter mit dem Typ `UploadFile`: //// tab | Python 3.9+ ```Python hl_lines="14" {!> ../../docs_src/request_files/tutorial001_an_py39.py!} ``` ////
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 11.3K bytes - Viewed (0) -
docs/pt/docs/tutorial/request_files.md
Mas existem vรกrios casos em que vocรช pode se beneficiar ao usar `UploadFile`. ## Parรขmetros de arquivo com `UploadFile` Defina um parรขmetro de arquivo com o tipo `UploadFile` //// tab | Python 3.9+ ```Python hl_lines="14" {!> ../../docs_src/request_files/tutorial001_an_py39.py!} ``` ////
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 10.8K bytes - Viewed (0) -
docs_src/request_files/tutorial001_03_an_py39.py
from typing import Annotated from fastapi import FastAPI, File, UploadFile app = FastAPI() @app.post("/files/") async def create_file(file: Annotated[bytes, File(description="A file read as bytes")]): return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file( file: Annotated[UploadFile, File(description="A file read as UploadFile")], ):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 421 bytes - Viewed (0) -
tests/test_multipart_installation.py
import warnings import pytest from fastapi import FastAPI, File, Form, UploadFile from fastapi.dependencies.utils import ( multipart_incorrect_install_error, multipart_not_installed_error, ) def test_incorrect_multipart_installed_form(monkeypatch): monkeypatch.setattr("python_multipart.__version__", "0.0.12") with warnings.catch_warnings(record=True): warnings.simplefilter("always")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 21:46:26 UTC 2024 - 5.7K bytes - Viewed (0) -
tests/test_compat.py
# For coverage # TODO: in theory this would allow declaring types that could be lists of UploadFile # and other types, but I'm not even sure it's a good idea to support it as a first # class "feature" assert is_uploadfile_sequence_annotation(Union[List[str], List[UploadFile]]) def test_is_pv1_scalar_field(): # For coverage class Model(BaseModel):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Sep 11 07:45:30 UTC 2024 - 3.5K bytes - Viewed (0) -
tests/test_datastructures.py
app = FastAPI() testing_file_store: List[UploadFile] = [] @app.post("/uploadfile/") def create_upload_file(file: UploadFile): testing_file_store.append(file) return {"filename": file.filename} client = TestClient(app) with path.open("rb") as file: response = client.post("/uploadfile/", files={"file": file}) assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 18 12:36:40 UTC 2023 - 2K bytes - Viewed (0) -
docs_src/request_files/tutorial001_02_an_py310.py
from typing import Annotated from fastapi import FastAPI, File, UploadFile app = FastAPI() @app.post("/files/") async def create_file(file: Annotated[bytes | None, File()] = None): if not file: return {"message": "No file sent"} else: return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file(file: UploadFile | None = None): if not file:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 505 bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_03_an.py
def test_post_upload_file(tmp_path): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") client = TestClient(app) with path.open("rb") as file: response = client.post("/uploadfile/", files={"file": file}) assert response.status_code == 200, response.text assert response.json() == {"filename": "test.txt"} def test_openapi_schema(): response = client.get("/openapi.json")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 6K bytes - Viewed (0)