You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wondering if the idea of streaming multipart file for uploading images has been explored or discussed before.
As far as my understanding goes, currently the UploadImage function expects a *multipart.File and reads it into memory which might become an issue for applications with large amount of traffic.
Instead of loading the file into memory, it can be streamed by streaming the file io.Reader to a io.Writer which can be piped to the request body
Please refer to my code below and sorry for my messy error handling.
Current cloudflare-go version
latest
Description
Just wondering if the idea of streaming multipart file for uploading images has been explored or discussed before.
As far as my understanding goes, currently the UploadImage function expects a
*multipart.File
and reads it into memory which might become an issue for applications with large amount of traffic.Instead of loading the file into memory, it can be streamed by streaming the file
io.Reader
to aio.Writer
which can be piped to the request bodyPlease refer to my code below and sorry for my messy error handling.
Use cases
Potential cloudflare-go usage
References
No response
The text was updated successfully, but these errors were encountered: