Skip to content

Instantly share code, notes, and snippets.

@Shaddix
Created October 18, 2018 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shaddix/f22feaffcc99fe653d8b8455ee967e19 to your computer and use it in GitHub Desktop.
Save Shaddix/f22feaffcc99fe653d8b8455ee967e19 to your computer and use it in GitHub Desktop.
[HttpGet("/q1")]
public IActionResult Get()
{
return new FileCallbackResult(new MediaTypeHeaderValue("application/octet-stream"),
async (stream, context) =>
{
context.HttpContext.Response.Body.Flush();
await Task.Delay(4000);
var data = Encoding.UTF8.GetBytes("asdaasdfasdfasdfasdfasdsdasdasd");
stream.Write(data, 0, data.Length);
})
{
FileDownloadName = "README.md"
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment