Closed psioukas closed 4 years ago
See: Issue 16
The last comment has an example in Kotlin using an AsyncTask
instance.
See: Issue 16
The last comment has an example in Kotlin using an
AsyncTask
instance.
Thank you ! :)
I tried it this way and it worked. Thank you
// Get SAS token from Azure Storage Explorer after creating permissions for a Blob Container , create an instance of StorageCredentialsSharedAccessSignature using the SAS token.
StorageCredentialsSharedAccessSignature SAS_TOKEN = new StorageCredentialsSharedAccessSignature("sas_token_permissions_from_storage_explorer");
try {
container = new CloudBlobContainer(URI.create("https://'account_name'.blob.core.windows.net/'blob_Container_name'"),SAS_TOKEN);
CloudBlockBlob blockBlob = container.getBlockBlobReference(fileName+fileType);
// Same file are overwritten. Using the following if statement it creates a new file.
if (blockBlob.exists()){
blockBlob=container.getBlockBlobReference(Calendar.getInstance().getTime()+"_"+file.getName());
}
//Upload file.
blockBlob.uploadFromFile(stringFilePath,null,null,null);
} catch (StorageException e) {
e.printStackTrace();
} catch (URISyntaxException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
@saio23 Thanks dude, this worked for me too.
Hello, I was wondering what are the steps, for using a Share key authentication, instead of providing the account name and key to each user. I am trying to use this library to share files between several users. Can we have more detailed examples for this situations?