Add Content-Length to requests to send file size

Fix for issue #2227. Sends a `Content-Length` header with PUT requests and sends a `Content-Length` header in each multipart file part.