none
Azure storage: Unable to upload block blob with size 0

    Question

  • Our applicaiton has a requirement to upload the blob with size 0. We are using cURL to invoke Azure storage REST API. While uploading with size it failing with HTTP error code [400]

    Following error message it returned


    <?xml version="1.0" encoding="utf-8"?>
        <Error>  
               <Code>InvalidHeaderValue</Code>
               <Message>
                      The value for one of the HTTP headers 
                      is not in the correct format.
                      RequestId:2b1ec18b-0001-007d-7811-e40725000000
                      Time:2016-07-22T12:07:28.5435467Z
              </Message>
              <HeaderName>Content-Length</HeaderName>
              <HeaderValue>-1</HeaderValue>
              </Error>
    

    Through wireshark, we ensured that, the value of content length header is sent appropriatly.

    Following are the captured headers from wireshark


    PUT /test/DC70439C-5004-11E6-B4B2-91D87435845D HTTP/1.1
    Host: mytest.blob.core.windows.net
    Accept: */*
    Transfer-Encoding: chunked
    x-ms-blob-type:BlockBlob
    x-ms-version:2015-02-21
    Content-Length:0
    x-ms-date:Fri, 22 Jul 2016 12:07:28 GMT
    Authorization:SharedKey   kanchan:HQQ7a47TPQtEhL0ek6rim64ZKC8NRubgKuq+4Os+Aoo=
    Expect: 100-continue
    

    Can you plese help to figure out why content-length header value has been set as -1?

    Thanks and regards, Rahul Naik

    Friday, July 22, 2016 12:34 PM

All replies