Invalid Header Value Error when calling Put Range Method

NagendraPrasad Gangu 50 Reputation points
2024-11-08T08:38:29.2566667+00:00

Hi All,

We are following below process to upload a file on to Azure Storage Container but Put Range is always failing with Invalid Header Value Error.

Create File : Able to upload an empty File .csv

Put Range : Failing with below error

The value for one of the HTTP headers is not in the correct format Error ,

HeaderName>Content-Length</HeaderName><HeaderValue>11</HeaderValue></Error>.

using the Headers as below

Can some one please help on this?

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,267 questions
{count} votes

Accepted answer
  1. Keshavulu Dasari 1,935 Reputation points Microsoft Vendor
    2024-11-12T16:19:35.41+00:00

    Hi NagendraPrasad Gangu,
    As discussed,https://learn.microsoft.com/en-us/answers/questions/2116755/the-value-for-one-of-the-http-headers-is-not-in-th

    <ns26:StandardHTTPHeaders>
    <ns26:Content-Length>0</ns26:Content-Length>
    </ns26:StandardHTTPHeaders>
    <ns26:CustomHTTPHeaders>
    <ns26:x-ms-version>2023-01-03</ns26:x-ms-version>
    <ns26:x-ms-type>file</ns26:x-ms-type>
    <ns26:x-ms-file-creation-time>now</ns26:x-ms-file-creation-time>
    <ns26:x-ms-file-last-write-time>now</ns26:x-ms-file-last-write-time>
    <ns26:x-ms-content-length>11</ns26:x-ms-content-length>
    <ns26:Content-Length>0</ns26:Content-Length>
    </ns26:CustomHTTPHeaders>
    

    Put Range

    nstrgmpr:HTTPHeaders

    <ns35:CustomHTTPHeaders>
    <ns35:x-ms-range>bytes=0-10</ns35:x-ms-range>
    <ns35:x-ms-version>2023-01-03</ns35:x-ms-version>
    <ns35:x-ms-write>update</ns35:x-ms-write>
    <ns35:Content-Length>11</ns35:Content-Length>
    

    User's image

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members. 

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. NagendraPrasad Gangu 50 Reputation points
    2024-11-12T17:19:25.1933333+00:00

    Thanks for the details. Finally, below worked.

    create file

    <ns26:StandardHTTPHeaders>
    
      <ns26:Content-Length>0</ns26:Content-Length>
    
    </ns26:StandardHTTPHeaders>
    
    <ns26:CustomHTTPHeaders>
    
      <ns26:x-ms-version>2023-01-03</ns26:x-ms-version>
    
      <ns26:x-ms-type>file</ns26:x-ms-type>
    
      <ns26:x-ms-file-creation-time>now</ns26:x-ms-file-creation-time>
    
      <ns26:x-ms-file-last-write-time>now</ns26:x-ms-file-last-write-time>
    
      <ns26:x-ms-content-length>11</ns26:x-ms-content-length>
    
      <ns26:Content-Length>0</ns26:Content-Length>
    
    </ns26:CustomHTTPHeaders>
    

    Put Range

    nstrgmpr:HTTPHeaders

    <ns35:CustomHTTPHeaders>
    
      <ns35:x-ms-range>bytes=0-10</ns35:x-ms-range>
    
      <ns35:x-ms-version>2023-01-03</ns35:x-ms-version>
    
      <ns35:x-ms-write>update</ns35:x-ms-write>
    
      <ns35:Content-Length>11</ns35:Content-Length>
    
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.