Created
November 9, 2020 22:58
-
-
Save vertonghenb/649e0d396877c5e5072fce09574106bf to your computer and use it in GitHub Desktop.
Blob Stream Example
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
[HttpGet] | |
public async Task<IActionResult> Get() | |
{ | |
BlobContainerClient container = new BlobContainerClient(_connectionString, "test"); | |
var blockBlob = container.GetBlobClient("test.mp4"); | |
Stream fileStream = new MemoryStream(); | |
var contentType = "multipart/x-mixed-replace;boundary=myboundary"; | |
await blockBlob.DownloadToAsync(fileStream); | |
var result = new FileStreamResult(fileStream, contentType) | |
{ | |
EnableRangeProcessing = true | |
}; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment