none
How to download a file and resume the downloading in Android. RRS feed

  • Question

  • I am unable to resume the downloading, Using method downloadRangeToByteArray.

    Kindly suggest how to download a file in azure blob with downloading percent and resume, and how can we cancel the current downloading. 

    Monday, September 16, 2019 6:53 AM

All replies

  • Apologies for the delay! Just for the clarification : Have you referred to the suggestion mentioned in this SO link.    

    To get started with Android and Azure, this is a good place to start:Click here

    Microsoft Azure Storage SDK for Android
    Download file using Azure Storage with resume download 

    For a more full featured sample check out the BlobTransferUI project for simple UI showing progress bars for multiple simultaneous uploads and downloads. You need to add in your code.

    If the issue still persists, Please share your code.  

    Hope this helps! 

    Kindly let us know if the above helps or you need further assistance on this issue. 

    ------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    Tuesday, September 17, 2019 5:45 AM
    Moderator
  • Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    • Marked as answer by Rohitashv Jain Wednesday, September 18, 2019 12:04 PM
    • Unmarked as answer by Rohitashv Jain Wednesday, September 18, 2019 12:04 PM
    Wednesday, September 18, 2019 8:20 AM
    Moderator
  • Hi Team,

    Thanks for the Answer.

    Can you please provide me a sample code for downloading with resume functionality (File should be start download from where it left).  I have URL with SAS token and i want to download the file using that URL.

    Kindly suggest me or provide a sample code for the same in Android.

    Thanks

    Wednesday, September 18, 2019 8:46 AM
  • According to the reference of Azure REST API Get Blobfor Storage Service, there is a parameter x-ms-range of request headers for downloading the part of Blob.

    x-ms-range

    Optional. Return only the bytes of the blob in the specified range. If both Range and x-ms-range are specified, the service uses the value of x-ms-range. If neither are specified, the entire blob contents are returned. See Specifying the Range Header for Blob Service Operations for more information.

    So you can resume the downloading process by pass the x-ms-range value with bytes=<the byte size of your downloaded>- to continous to download the full tail of a blob in a working thread.

    Or considering for the performance, you can first to get the byte size of a blob, and then to use x-ms-range to download the slices of a blob separately in multiple working threads and concat the blob slices to a completed one.

    In Azure Storage for Java v8(Legacy), directly to use the downloadRange method of CloudBlob with parameter offset and length(it equals x-ms-range: <offset>-<offset+length>).

    In Azure Storage for Java v10, to pass a BlobRange object to the download method of BlobURL

    Kindly refer to the suggestion mentioned in this MSDN thread. 

    Kindly let us know if the above helps or you need further assistance on this issue. 

    ------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    Tuesday, September 24, 2019 3:34 PM
    Moderator
  • Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    Thursday, September 26, 2019 5:39 AM
    Moderator
  • Just checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.
    Friday, September 27, 2019 8:57 AM
    Moderator
  • Following up to see if the above suggestion was helpful. And, if you have any further query do let us know. If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members

    Tuesday, October 22, 2019 3:12 AM
    Moderator