-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save large request bodies to temporary directory #3
Comments
Hi @jivank |
I think it is an I have used https://github.com/OpenSystemsLab/tempfile.nim and it seems to work well. I think using this in combination with https://nim-lang.org/docs/streams.html which contains a FileStream and StringStream may be in the right direction (giving a common interface for the procs used, since |
May be related with this, here were changes in |
Yes, but I think instead of a callback (which sounds nice, but all frameworks would have to accommodate for it), we can just add something like |
I think netkit is very suitable for this task, it has a better interface based on buffer and stream. |
…mplete is called before write
To be able to handle large uploads, it would be helpful to have a setting such that sets the limit of a request body to a certain Content-Length (lets say 8MB). Any Content-Length above 8MB will be streamed to disk rather than parsed in memory.
I don't think there are any implementations of this for any of the Nim projects yet. But you can see how it's done with Python.
See Werkzeug:
https://github.com/pallets/werkzeug/blob/ef545f0d0bf28cbad02066b4cb7471bea50a93ee/src/werkzeug/formparser.py#L59
The text was updated successfully, but these errors were encountered: