1

I am a newbie in the Azure storage. Is there any way to save an image from URL to Azure storage directly without downloading the image?

Akmal
  • 71
  • 1
  • 2
  • 14

1 Answers1

1

Copy Blob REST API can satisfy your requirement, you just need to specify the image URL as the source Blob.

If you're developing with C#, you can leverage StartCopy method.

If you're developing with node.js, you can leverage startCopyBlob method.

Zhaoxing Lu
  • 6,319
  • 18
  • 41
  • Thanks for your answer. – Akmal Jul 10 '17 at 06:01
  • If I am not mistaken, startCopyBlob is used when the source is also BLOB. In my case, I want to save the content of the URL into Azure storage. For example, I have the URL of the FB's profile picture, and I want to save the profile picture's image into Azure storage. – Akmal Jul 10 '17 at 07:24
  • Actually you can specify any public URL in the source of startCopyBlob, https://stackoverflow.com/questions/20413627/copy-file-from-url-to-azure-blob https://stackoverflow.com/questions/12017106/uploading-file-directly-from-a-url-in-storage-blob – Zhaoxing Lu Jul 10 '17 at 08:00
  • how to know that the copying processes is finished? and how to get the URL of the uploaded blob? – Akmal Jul 10 '17 at 08:44
  • You can construct the URL of the uploaded blob by yourself since target container and target blob name is specified by you in startCopyBlob method. To query copy progress, you can call getBlobProperties methods on the target bob and check "copy" object of BlobResult in the callback. https://azure.github.io/azure-storage-node/BlobService.html#getBlobProperties__anchor https://azure.github.io/azure-storage-node/BlobResult.html – Zhaoxing Lu Jul 10 '17 at 09:44