Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for upload_file (0.29 sec)

  1. tests/test_tutorial/test_request_files/test_tutorial001.py

                        "operationId": "create_upload_file_uploadfile__post",
                        "requestBody": {
                            "content": {
                                "multipart/form-data": {
                                    "schema": {
                                        "$ref": "#/components/schemas/Body_create_upload_file_uploadfile__post"
                                    }
                                }
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.7K bytes
    - Viewed (2)
  2. tests/test_tutorial/test_request_files/test_tutorial001_an.py

                        "operationId": "create_upload_file_uploadfile__post",
                        "requestBody": {
                            "content": {
                                "multipart/form-data": {
                                    "schema": {
                                        "$ref": "#/components/schemas/Body_create_upload_file_uploadfile__post"
                                    }
                                }
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial002.py

    
    def test_post_upload_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        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=(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py

                        "operationId": "create_upload_file_uploadfile__post",
                        "requestBody": {
                            "content": {
                                "multipart/form-data": {
                                    "schema": {
                                        "$ref": "#/components/schemas/Body_create_upload_file_uploadfile__post"
                                    }
                                }
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  5. fastapi/datastructures.py

        ```python
        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[
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_files/test_tutorial002_an.py

    
    def test_post_upload_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        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=(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py

    
    @needs_py39
    def test_post_upload_file(tmp_path, app: FastAPI):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        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=(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_request_files/test_tutorial002_py39.py

    
    @needs_py39
    def test_post_upload_file(tmp_path, app: FastAPI):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        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=(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9K bytes
    - Viewed (0)
  9. 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
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 472 bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/request-files.md

    โœ”๏ธ ๐Ÿคฏ ๐Ÿ‘ˆ ๐Ÿ‘‰ โ›“ ๐Ÿ‘ˆ ๐ŸŽ‚ ๐ŸŽš ๐Ÿ”œ ๐Ÿช ๐Ÿ’พ. ๐Ÿ‘‰ ๐Ÿ”œ ๐Ÿ‘ท ๐Ÿ‘ ๐Ÿคช ๐Ÿ“.
    
    โœ‹๏ธ ๐Ÿ“ค ๐Ÿ“š ๐Ÿ’ผ โ” ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ’ฐ โšช๏ธโžก๏ธ โš™๏ธ `UploadFile`.
    
    ## ๐Ÿ“ ๐Ÿ”ข โฎ๏ธ `UploadFile`
    
    ๐Ÿ”ฌ ๐Ÿ“ ๐Ÿ”ข โฎ๏ธ ๐Ÿ†Ž `UploadFile`:
    
    ```Python hl_lines="12"
    {!../../../docs_src/request_files/tutorial001.py!}
    ```
    
    โš™๏ธ `UploadFile` โœ”๏ธ ๐Ÿ“š ๐Ÿ“ˆ ๐Ÿคญ `bytes`:
    
    * ๐Ÿ‘† ๐Ÿšซ โœ”๏ธ โš™๏ธ `File()` ๐Ÿ”ข ๐Ÿ’ฒ ๐Ÿ”ข.
    * โšซ๏ธ โš™๏ธ "๐Ÿงต" ๐Ÿ“:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 6.6K bytes
    - Viewed (0)
Back to top