Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1487

Blob content length is mandatory while uploading to Azure

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1.1
    • None
    • jclouds-blobstore

    Description

      Content length is mandatory while uploading to Azure using JClouds portable Blob Store API

      Blob blob = blobStore.blobBuilder(blobName)
       .payload(new InputStreamPayload(inputStream))
       .contentType(contentType)
       .build();
      
      blobStore.putBlob(container, blob);
      

      BindAzureBlobMetadataToRequest class checks that content length is specified and is greater than zero in lines 58-59. However, according to the Azure SDK documentation, Azure CloudBlockBlob also accepts -1 if content length is unknown: 

      length - A long which represents the length, in bytes, of the stream data, or -1 if unknown.

       

      We have a use case when we need to stream a big chunk of data of unknown size directly into a cloud storage. Portable JClouds API allows to upload files into OpenStack SWIFT without specifying their size, but it fails on Azure.

      Attachments

        1. length_exception.txt
          2 kB
          Alexander Chernavin

        Activity

          People

            Unassigned Unassigned
            achernavin Alexander Chernavin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: