pester icon indicating copy to clipboard operation
pester copied to clipboard

what if i have a 10GB file to upload?

Open fredwangwang opened this issue 6 years ago • 3 comments

Seems like the logic is going to cache the file in-memory, which is super expensive to a simple HTTP POST.

fredwangwang avatar Oct 15 '18 16:10 fredwangwang

I've been moving across the county; a bit swamped. Any suggestions? PRs welcome :)

sethgrid avatar Nov 20 '18 23:11 sethgrid

sorry, i dont monitor my email that much...

Some thinkings: Provide additional layer to wrap some common file upload protocols. For example: plain post upload, multipart upload.

Then the wrapping layer can ask the user for raw file input instead of io.reader. The advantage of this is every time the upload fails and retries, the file can be rewind to the start of the stream. No data is lost, no need to store in-mem as well.

But talking this out loud here, it is probably not wise to keep retrying upload large files anyways. Some resumable upload protocol should be used instead of "brute force uploading". So adding a warning to stderr when detecting the user has a really large payload probably good enough?

fredwangwang avatar Dec 03 '18 20:12 fredwangwang

Would it be possible in this case to detect an io.ReadSeeker? That way you could seek back to the beginning and read again?

derekbassett avatar May 15 '19 14:05 derekbassett