Skip to content

Multipart upload of empty file fails #30

Description

@sqs

If you call Create and then immediately Close the file without writing anything (e.g., for an empty file), the upload fails and no file is created. This is because the Close method sends a CompleteMultipartUpload tag with no children:

POST /xxx/asdf.txt?uploadId=xxx HTTP/1.1
Host: xxx
User-Agent: Go 1.1 package http
Content-Length: 51
Authorization: AWS xxx
Date: Wed, 07 Jan 2015 16:57:26 GMT
Accept-Encoding: gzip

<CompleteMultipartUpload></CompleteMultipartUpload>

HTTP/1.1 400 Bad Request
Connection: close
Transfer-Encoding: chunked
Content-Type: application/xml
Date: Wed, 07 Jan 2015 16:57:26 GMT
Server: AmazonS3
X-Amz-Id-2: xxx
X-Amz-Request-Id: xxx

118
<Error><Code>MalformedXML</Code><Message>The XML you provided was not well-formed or did not validate against our published schema</Message><RequestId>xxx</RequestId><HostId>xxx</HostId></Error>

The AWS API docs at http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadComplete.html say that the CompleteMultipartUpload element requires one or more Parts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions