Download to and upload from stream

Currently, the download and upload function will save the data to a file/read the data from a file.
It would be great when it could read/write data from/to a stream, like a memory stream, so data can be processed right away in memory without the need to load them from a file.