none
I can not upload a file to azure storage

    Question

  • Hello,

    as in subject , I can't upload a file in azure storage. I tried with "visual studio", "azure explorer" and "azure powershell". 

    I have a quite understandable response only using PowerShell : HTTP Status Code: 400 - HTTP Error - Message: The specified blob or block content is invalid.

    I can upload other file. I can upload the same file renamed.

    Thanks

    Andrea

    Monday, April 04, 2016 12:02 PM

Answers

  • I get it

    "If the container's ACL is set to allow anonymous access, any client may call Get Block List; however, only committed blocks can be accessed publicly. Access to the uncommitted block list is restricted to the account owner and to anyone using a Shared Access Signature that has permission to read this blob or its container."

    I 'll try again.

    Andrea

    Tuesday, April 05, 2016 7:34 AM

All replies

  • Hi Andrea,

    For a given blob, all block IDs must be the same length. If a block is uploaded with a block ID of a different length than the block IDs for any existing uncommitted blocks, the service returns error response code 400 (Bad Request).

    In your case, probably there was a cancelled operation earlier, and we still have uncommitted blocks which Azure storage keeps for a period of time. You can check whether that is the case by calling the getBlockList API https://msdn.microsoft.com/library/azure/dd179400.aspx.

    Regards,

    Yuan Zheng

    Monday, April 04, 2016 7:20 PM
  • Hi and thanks.

    I tried to search this cancelled operation using documentation. So when I use this line :

    https://MYACCOUNT.blob.core.windows.net/MYCONTAINER/THE_FILE_TO_UPLOADi?comp=blocklist

    I have this response 

    <BlockList>
    <CommittedBlocks/>

    </BlockList>

    Same response if I use this 

    https://MYACCOUNT.blob.core.windows.net/MYCONTAINER/THE_FILE_TO_UPLOADi?comp=blocklist&blocklisttype=committed    because, I think, "committed" type is default.

    On the contrary, if i use this Get, because i'm looking for "uncommitted" block:

    https://MYACCOUNT.blob.core.windows.net/MYCONTAINER/THE_FILE_TO_UPLOADi?comp=blocklist&blocklisttype=all     or this

    https://MYACCOUNT.blob.core.windows.net/MYCONTAINER/THE_FILE_TO_UPLOADi?comp=blocklist&blocklisttype=uncommitted

    I have this response 

    <Error>
    <Code>ResourceNotFound</Code>
    <Message>

    The specified resource does not exist. RequestId:*********************** Time:2016-04-05T07:11:32.0087314Z

    </Message>
    </Error>

    This answer is still the same as when I ask a file that does not exist 

    https://MYACCOUNT.blob.core.windows.net/MYCONTAINER/THE_FILE_INVENTEDi?comp=blocklist

    When I ask for a file that is in container i can see the correct answer 

    What am I doing wrong?

    Thanks

    Andrea

    Tuesday, April 05, 2016 7:21 AM
  • I get it

    "If the container's ACL is set to allow anonymous access, any client may call Get Block List; however, only committed blocks can be accessed publicly. Access to the uncommitted block list is restricted to the account owner and to anyone using a Shared Access Signature that has permission to read this blob or its container."

    I 'll try again.

    Andrea

    Tuesday, April 05, 2016 7:34 AM