- Sort Score
- Num 10 results
- Language All
Results 11 - 20 of 62 for file_size (0.07 seconds)
-
docs_src/request_files/tutorial001_03_py39.py
from fastapi import FastAPI, File, UploadFile app = FastAPI() @app.post("/files/") async def create_file(file: bytes = File(description="A file read as bytes")): return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file( file: UploadFile = File(description="A file read as UploadFile"), ):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 371 bytes - Click Count (0) -
docs_src/request_files/tutorial001_02_py39.py
app = FastAPI() @app.post("/files/") async def create_file(file: Union[bytes, None] = File(default=None)): if not file: return {"message": "No file sent"} else: return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file(file: Union[UploadFile, None] = None): if not file: return {"message": "No upload file sent"} else:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 508 bytes - Click Count (0) -
docs_src/request_forms_and_files/tutorial001_an_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 386 bytes - Click Count (0) -
docs_src/request_files/tutorial001_02_py310.py
app = FastAPI() @app.post("/files/") async def create_file(file: bytes | None = File(default=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: return {"message": "No upload file sent"} else:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 470 bytes - Click Count (0) -
docs_src/request_files/tutorial001_02_an_py39.py
app = FastAPI() @app.post("/files/") async def create_file(file: Annotated[Union[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: Union[UploadFile, None] = None): if not file: return {"message": "No upload file sent"} else:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 524 bytes - Click Count (0) -
tests/test_tutorial/test_request_files/test_tutorial001_03.py
path.write_bytes(b"<file content>") with path.open("rb") as file: response = client.post("/files/", files={"file": file}) assert response.status_code == 200, response.text assert response.json() == {"file_size": 14} def test_post_upload_file(tmp_path, client: TestClient): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") with path.open("rb") as file:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 6.2K bytes - Click Count (0) -
docs/resiliency/resiliency-tests.sh
UUID=$(echo $UUID | cut -d " " -f 9 | cut -d "/" -f 6) # Determine head and tail size of file where we will introduce bitrot FILE_SIZE=$(docker exec resiliency-minio$NODE-1 /bin/sh -c "stat --printf="%s" $DIR/test-bucket/initial-data/$FILE/$UUID/part.1") TAIL_SIZE=$((FILE_SIZE - 32 * 2)) # Extract head and tail of file
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sat Dec 21 04:24:45 GMT 2024 - 20.5K bytes - Click Count (0) -
tests/test_tutorial/test_request_files/test_tutorial001_02.py
path.write_bytes(b"<file content>") with path.open("rb") as file: response = client.post("/files/", files={"file": file}) assert response.status_code == 200, response.text assert response.json() == {"file_size": 14} def test_post_upload_file(tmp_path: Path, client: TestClient): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") with path.open("rb") as file:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 7.4K bytes - Click Count (0) -
tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
data={"token": "foo"}, files={"file": filea, "fileb": ("testb.txt", fileb, "text/plain")}, ) assert response.status_code == 200, response.text assert response.json() == { "file_size": 14, "token": "foo", "fileb_content_type": "text/plain", } def test_openapi_schema(client: TestClient): response = client.get("/openapi.json")Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 7.3K bytes - Click Count (0) -
fastapi/datastructures.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): return {"filename": file.filename} ``` """ file: Annotated[ BinaryIO,Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 5.1K bytes - Click Count (0)