Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 215 for file (0.14 sec)

  1. docs/em/docs/tutorial/request-files.md

    ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ”ฌ ๐Ÿ“ ๐Ÿ“‚ ๐Ÿ‘ฉโ€๐Ÿ’ป โš™๏ธ `File`.
    
    !!! info
        ๐Ÿ“จ ๐Ÿ“‚ ๐Ÿ“, ๐Ÿฅ‡ โŽ <a href="https://github.com/Kludex/python-multipart" class="external-link" target="_blank">`python-multipart`</a>.
    
        ๐Ÿคถ โ“‚. `pip install python-multipart`.
    
        ๐Ÿ‘‰ โ†ฉ๏ธ ๐Ÿ“‚ ๐Ÿ“ ๐Ÿ“จ "๐Ÿ“จ ๐Ÿ’ฝ".
    
    ## ๐Ÿ—„ `File`
    
    ๐Ÿ—„ `File` &amp; `UploadFile` โšช๏ธโžก๏ธ `fastapi`:
    
    ```Python hl_lines="1"
    {!../../../docs_src/request_files/tutorial001.py!}
    ```
    
    ## ๐Ÿ”ฌ `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)
  2. docs/ko/docs/tutorial/request-files.md

    ```
    
    ## `File` ๋งค๊ฐœ๋ณ€์ˆ˜ ์ •์˜
    
    `Body` ๋ฐ `Form` ๊ณผ ๋™์ผํ•œ ๋ฐฉ์‹์œผ๋กœ ํŒŒ์ผ์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค:
    
    ```Python hl_lines="7"
    {!../../../docs_src/request_files/tutorial001.py!}
    ```
    
    !!! info "์ •๋ณด"
        `File` ์€ `Form` ์œผ๋กœ๋ถ€ํ„ฐ ์ง์ ‘ ์ƒ์†๋œ ํด๋ž˜์Šค์ž…๋‹ˆ๋‹ค.
    
        ํ•˜์ง€๋งŒ `fastapi`๋กœ๋ถ€ํ„ฐ `Query`, `Path`, `File` ๋“ฑ์„ ์ž„ํฌํŠธ ํ•  ๋•Œ, ์ด๊ฒƒ๋“ค์€ ํŠน๋ณ„ํ•œ ํด๋ž˜์Šค๋“ค์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜๋ผ๋Š” ๊ฒƒ์„ ๊ธฐ์–ตํ•˜๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.
    
    !!! tip "ํŒ"
        File์˜ ๋ณธ๋ฌธ์„ ์„ ์–ธํ•  ๋•Œ, ๋งค๊ฐœ๋ณ€์ˆ˜๊ฐ€ ์ฟผ๋ฆฌ ๋งค๊ฐœ๋ณ€์ˆ˜ ๋˜๋Š” ๋ณธ๋ฌธ(JSON) ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ํ•ด์„๋˜๋Š”  ๊ฒƒ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด `File` ์„ ์‚ฌ์šฉํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  3. docs/ru/docs/tutorial/request-forms-and-files.md

    ## ะžะฟั€ะตะดะตะปะธั‚ะต ะฟะฐั€ะฐะผะตั‚ั€ั‹ `File` ะธ `Form`
    
    ะกะพะทะดะฐะนั‚ะต ะฟะฐั€ะฐะผะตั‚ั€ั‹ ั„ะฐะนะปะฐ ะธ ั„ะพั€ะผั‹ ั‚ะฐะบะธะผ ะถะต ะพะฑั€ะฐะทะพะผ, ะบะฐะบ ะดะปั `Body` ะธะปะธ `Query`:
    
    === "Python 3.9+"
    
        ```Python hl_lines="10-12"
        {!> ../../../docs_src/request_forms_and_files/tutorial001_an_py39.py!}
        ```
    
    === "Python 3.6+"
    
        ```Python hl_lines="9-11"
        {!> ../../../docs_src/request_forms_and_files/tutorial001_an.py!}
        ```
    
    === "Python 3.6+ ะฑะตะท Annotated"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  4. docs_src/request_forms_and_files/tutorial001_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, File, Form, UploadFile
    
    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 May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 386 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_files/test_tutorial001_03.py

    from fastapi.testclient import TestClient
    
    from docs_src.request_files.tutorial001_03 import app
    
    client = TestClient(app)
    
    
    def test_post_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("/files/", files={"file": file})
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 6K bytes
    - Viewed (0)
  6. docs_src/request_files/tutorial001_02_py310.py

    from fastapi import FastAPI, File, UploadFile
    
    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 May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 470 bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/testing.md

    And your **FastAPI** application might also be composed of several files/modules, etc.
    
    ### **FastAPI** app file
    
    Let's say you have a file structure as described in [Bigger Applications](bigger-applications.md){.internal-link target=_blank}:
    
    ```
    .
    โ”œโ”€โ”€ app
    โ”‚ย ย  โ”œโ”€โ”€ __init__.py
    โ”‚ย ย  โ””โ”€โ”€ main.py
    ```
    
    In the file `main.py` you have your **FastAPI** app:
    
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/testing-database.md

    The only changes here are in the new testing file.
    
    Your normal dependency `get_db()` would return a database session.
    
    In the test, you could use a dependency override to return your *custom* database session instead of the one that would be used normally.
    
    In this example we'll create a temporary database only for the tests.
    
    ## File structure
    
    We create a new file at `sql_app/tests/test_sql_app.py`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  9. docs/en/docs/contributing.md

    That command created a file `docs/ht/mkdocs.yml` with a simple config that inherits everything from the `en` version:
    
    ```yaml
    INHERIT: ../en/mkdocs.yml
    ```
    
    !!! tip
        You could also simply create that file with those contents manually.
    
    That command also created a dummy file `docs/ht/index.md` for the main page, you can start by translating that one.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 17:42:43 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/path-params.md

    }
    ```
    
    ## Path parameters containing paths
    
    Let's say you have a *path operation* with a path `/files/{file_path}`.
    
    But you need `file_path` itself to contain a *path*, like `home/johndoe/myfile.txt`.
    
    So, the URL for that file would be something like: `/files/home/johndoe/myfile.txt`.
    
    ### OpenAPI support
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
Back to top