Last active
April 2, 2016 20:18
-
-
Save vmussak/e87ad20fa5c5d12e400257c80efe0331 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IActionResult Excluir() | |
{ | |
//Cria um blob client | |
CloudBlobClient blobClient = _storageAccount.CreateCloudBlobClient(); | |
//Recupera a referencia do container documentos | |
CloudBlobContainer container = blobClient.GetContainerReference("documentos"); | |
//Caso não exista, ele cria | |
container.CreateIfNotExists(); | |
//Setar permissão de acesso para 'público' | |
container.SetPermissions( | |
new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob } | |
); | |
//Recupera a referência de um blob chamado 'cliente01' | |
CloudBlockBlob blockBlob = container.GetBlockBlobReference("cliente01.pdf"); | |
//Exclui o blob caso ele exista. | |
blockBlob.DeleteIfExists(); | |
return RedirectToAction("VerArquivos"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment