Replies: 1 comment
-
|
The The streaming part is a separate issue. Once you call If the goal is "receive multipart and stream it directly to HTTPX without buffering each file first", the current high-level |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, a few things.
UploadFile.seekalso take thewhence? So it would conform to the "real"seektype.AnyIOcould it use theanyio.SpooledTemporaryFileinstead of relying on it's ownUploadFilefor async capabilities?Where is this coming from:
I have a HTTPX client I'm using to steam a file to a 3rd party service. I appreciate that we have the spooled file but still the entire file needs to go through my ASGI app to be potentially stored on disk for me to read it to stream it forward - let's call this "store and forward". I wonder if there's any chance for me to load a chunk and pass is forward, load next chunk and so on - imagine:
(the content needs to be an AsyncGenerator httpx docs)
Another thing, ignoring the "cut through" upload. My client for that 3rd party service I upload files to can't rely on the UploadFile as sometimes I upload files I download and since the UploadFile is not of the same protocol as let's say the AnyIO Spooled File I would use there, it's (needlessly?) hard to deal with big files in Starlette based apps - that's said I'm not completely sure I'm onto something here.
I guess I'm trying to avoid loading big files, now what is the usual path:
seek(0, 2); tell())read(8); seek(0))Less of this is in RAM and less times I need to
seek(0)toreadthe thing the better.I hope I'm making sense.
Beta Was this translation helpful? Give feedback.
All reactions