Created
April 2, 2016 14:10
-
-
Save vmussak/afb3bfa4becc8e94a813f1b9caf84099 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 VerArquivos() | |
{ | |
//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 os arquivos de um container | |
var arquivos = container.ListBlobs(); | |
return View("Documentos", arquivos); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment