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

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -