How to upload a file from internet to azure storage as a blob using java code? -


i want upload file directly internet azure blob storage in "mycontainer" , dont want download file first in local upload. want using java code, can please me sample code.

based on understanding, think want directly upload file internet url azure blob storage. can use method cloudblob.startcopy(uri source) implement needs.

here sample code.

string connectionstring = string.format("defaultendpointsprotocol=http;accountname=%s;accountkey=%s", account_name, account_key); cloudstorageaccount account = cloudstorageaccount.parse(connectionstring); cloudblobclient client = account.createcloudblobclient(); cloudblobcontainer container = client.getcontainerreference("mycontainer"); cloudblockblob blob = container.getblockblobreference("bing.txt");  string uri = "http://www.bing.com"; blob.startcopy(new uri(uri)); 

hope helps.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -