Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 72 for file_size (0.21 sec)

  1. docs_src/request_forms_and_files/tutorial001_an_py39.py

    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(
        file: Annotated[bytes, File()],
        fileb: Annotated[UploadFile, File()],
        token: Annotated[str, Form()],
    ):
        return {
            "file_size": len(file),
            "token": token,
            "fileb_content_type": fileb.content_type,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 386 bytes
    - Viewed (0)
  2. 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:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 470 bytes
    - Viewed (0)
  3. docs_src/request_forms_and_files/tutorial001_an.py

    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(
        file: Annotated[bytes, File()],
        fileb: Annotated[UploadFile, File()],
        token: Annotated[str, Form()],
    ):
        return {
            "file_size": len(file),
            "token": token,
            "fileb_content_type": fileb.content_type,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 396 bytes
    - Viewed (0)
  4. docs_src/request_forms_and_files/tutorial001.py

    from fastapi import FastAPI, File, Form, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(
        file: bytes = File(), fileb: UploadFile = File(), token: str = Form()
    ):
        return {
            "file_size": len(file),
            "token": token,
            "fileb_content_type": fileb.content_type,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 317 bytes
    - Viewed (0)
  5. docs_src/request_files/tutorial001_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()]):
        return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: UploadFile):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 332 bytes
    - Viewed (0)
  6. docs_src/request_files/tutorial001_03.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"),
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 371 bytes
    - Viewed (0)
  7. docs_src/request_files/tutorial001_03_an.py

    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")],
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 431 bytes
    - Viewed (0)
  8. 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:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 524 bytes
    - Viewed (0)
  9. tensorflow/c/experimental/filesystem/plugins/gcs/ram_file_block_cache_test.cc

      EXPECT_TRUE(first_block);
      EXPECT_EQ(out.size(), block_size);
      // Reading at offset file_size + 4 will read the second block (since the read
      // at file_size + 4 = 28 will be aligned to an offset of 16) but will return
      // OutOfRange because the offset is past the end of the 24-byte file.
      Status status = ReadCache(&cache, "", file_size + 4, 4, &out);
      EXPECT_EQ(status.code(), error::OUT_OF_RANGE);
      EXPECT_TRUE(second_block);
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Oct 15 03:16:57 GMT 2021
    - 23.2K bytes
    - Viewed (0)
  10. docs_src/request_files/tutorial001.py

    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: bytes = File()):
        return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: UploadFile):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 282 bytes
    - Viewed (0)
Back to top