I'd prefer if this took an open file handle, making the function a little more flexible. For example, allowing you to upload contents from a `request.get` call when downloading content from a URL.