upload_file: Can now specify content_length

The caller can now specify content_length for the file-like object, if
known. Doing so avoids the call to get_file_size(), which would not work
if the file is not seekable.

The result is that a file can be uploaded from a portion of a streamed
HTTP request.