fileshandling

Module Contents

Functions

create_upload_file(file: fastapi.UploadFile = File(...))

create_upload_file(file: fastapi.UploadFile = File(...))

get_file(name_file: str) → fastapi.responses.FileResponse

Download file from server

delete_file(name_file: str)

Attributes

router

upload_dir

allowed_mime_types

fileshandling.router
fileshandling.upload_dir
fileshandling.allowed_mime_types = ['text/csv', 'application/pdf', 'text/plain', 'chemical/x-cif',...
async fileshandling.create_upload_file(file: fastapi.UploadFile = File(...))
async fileshandling.create_upload_file(file: fastapi.UploadFile = File(...))
fileshandling.get_file(name_file: str) fastapi.responses.FileResponse

Download file from server

Parameters

name_file (str) – file name to download expressed as <hash>.<ext>

Raises

HTTPException – HTTP Error 404 if file not found

Returns

binary stream of file

Return type

FileResponse

fileshandling.delete_file(name_file: str)