コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 5 of about 5 for filename (0.002 sec.)
Request Files 12832
Request Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can define files to be uploaded by the client using File . Info To receive uploaded files, first ... { "file_size" : len ( file )} @app . post ( "/uploadfile/" ) async def create_upload_file ( file : UploadFile ): return { "filename" : file . filename } ? Other versions and variants Python 3.8+ Python 3.8+ - non-Annotated from fastapi import FastAPI , F ... { "file_size" : len ( file )} @app . post ( "/uploadfile/" ) async def create_upload_file ( file : UploadFile ): return { "filename" : file . filename } Tip Prefer to use the Annotated version if possible. from fastapi import FastAPI , File , UploadFile ... { "file_size" : len ( file )} @app . post ( "/uploadfile/" ) async def create_upload_file ( file : UploadFile ): return { "filename" : file . filename } Define File Parameters Create file parameters the same way you would for Body or Form : Python 3.9+ f ...
https://man.mtool.work/fastapi/0.115/tutorial/request-files/
UploadFile class 8622
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 : from fastapi import UploadFile ::: fastapi.UploadFile options: memb ... ers: - file - filename - size - headers - content_type - read - write - seek - close ...
https://man.mtool.work/fastapi/0.115/reference/uploadfile/
Settings and Environment Variables 8218
Settings and Environment Variables Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In many cases your application could need some external settings or configuratio ... . ) is a hidden file in Unix-like systems, like Linux and macOS. But a dotenv file doesn't really have to have that exact filename. Pydantic has support for reading from these types of files using an external library. You can read more at Pydantic Setti ... to define that dict . Here we define the config env_file inside of your Pydantic Settings class, and set the value to the filename with the dotenv file we want to use. Creating the Settings only once with lru_cache Reading a file from disk is normally a ...
https://man.mtool.work/fastapi/0.115/advanced/settings/
Behind a Proxy 8107
Behind a Proxy Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some situations, you might need to use a proxy server like Traefik or Nginx with a configuration ... nal. Then create a file traefik.toml with: [entryPoints] [entryPoints.http] address = ":9999" [providers] [providers.file] filename = "routes.toml" This tells Traefik to listen on port 9999 and to use another file routes.toml . Tip We are using port 9999 ...
https://man.mtool.work/fastapi/0.115/advanced/behind-a-proxy/
カスタムレスポンス - HTML、ストリーム、ファイル、その他のレスポンス 8107
カスタムレスポンス - HTML、ストリーム、ファイル、その他のレスポンス デフォルトでは、 FastAPI は JSONResponse を使ってレスポンスを返します。 レスポンスを直接返す で見たように、 Response を直接返すことでこの挙動をオーバーライドできます。 しか ... 辞書。 media_type - メディアタイプを示す文字列。セットされなかった場合は、ファイル名やパスからメディアタイプが推察されます。 filename - セットされた場合、レスポンスの Content-Disposition に含まれます。 ファイルレスポンスには、適切な Content-Length 、 Last- ...
https://man.mtool.work/fastapi/0.115/advanced/custom-response/
PREV 1 NEXT