- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 58 for uploadeFile (0.08 sec)
-
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 - read
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:53:19 UTC 2024 - 472 bytes - Viewed (0) -
fastapi/datastructures.py
from starlette.datastructures import UploadFile as StarletteUploadFile from typing_extensions import Annotated, Doc 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`
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Apr 02 02:48:51 UTC 2024 - 5.6K bytes - Viewed (0) -
docs_src/request_files/tutorial001_03_an.py
from fastapi import FastAPI, File, UploadFile from typing_extensions import Annotated 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 - 431 bytes - Viewed (0) -
docs_src/request_files/tutorial001_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()]): return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file(file: UploadFile):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 322 bytes - Viewed (0) -
docs_src/request_files/tutorial002.py
from typing import List from fastapi import FastAPI, File, UploadFile from fastapi.responses import HTMLResponse app = FastAPI() @app.post("/files/") async def create_files(files: List[bytes] = File()): return {"file_sizes": [len(file) for file in files]} @app.post("/uploadfiles/") async def create_upload_files(files: List[UploadFile]): return {"filenames": [file.filename for file in files]} @app.get("/")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri May 13 23:38:22 UTC 2022 - 811 bytes - Viewed (0) -
docs_src/request_files/tutorial002_an_py39.py
from typing import Annotated 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()]): return {"file_sizes": [len(file) for file in files]} @app.post("/uploadfiles/") async def create_upload_files(files: list[UploadFile]): return {"filenames": [file.filename for file in files]}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 826 bytes - Viewed (0) -
docs/pt/docs/tutorial/request-files.md
Mas há muitos casos em que você pode se beneficiar do uso de `UploadFile`. ## Parâmetros de Arquivo com `UploadFile` Defina um parâmetro de arquivo com um tipo de `UploadFile`: {* ../../docs_src/request_files/tutorial001_an_py39.py hl[14] *} Utilizar `UploadFile` tem várias vantagens sobre `bytes`: * Você não precisa utilizar o `File()` no valor padrão do parâmetro.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 30 19:52:32 UTC 2024 - 7.8K bytes - Viewed (0) -
tests/test_tutorial/test_request_files/test_tutorial001_02_an.py
response = client.post("/files/") assert response.status_code == 200, response.text assert response.json() == {"message": "No file sent"} def test_post_uploadfile_no_body(): response = client.post("/uploadfile/") assert response.status_code == 200, response.text assert response.json() == {"message": "No upload file sent"} def test_post_file(tmp_path): path = tmp_path / "test.txt"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 8.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_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)