This repository has been archived by the owner on Jul 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Support for File #9
Labels
enhancement
New feature or request
Comments
@Tanmoy741127 , about your first point: would it be possible to use from pathlib import Path
def get_file(name) -> Path:
return Path(name) |
@dosisod working on that. User can return an instance of file like you show. |
@dosisod added support for serve filesin latest version. Check the README file. Give it a try and provide feedback please. |
Will do! I'll take a look at it in the next couple of days |
@dosisod sure |
. |
Sorry for the delay on this! A couple notes:
from lumi import Lumi
def index(file: str):
return open(file)
You can check this with the following: from pathlib import Path
if Path("some/file/name").is_relative_to(Path.cwd()):
# handle file
else:
# return 403 or 404 error
Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently, Lum supports communication over JSON only.
But in real life, we need to upload files and also download files from Server. So we will bring that support
Tasks -
application/x-www-form-urlencoded
andmultipart/form-data
types #8 . After then we can work on this. When the file will receive we will cast it to file and pass it to functionThe text was updated successfully, but these errors were encountered: