Skip to content

Instantly share code, notes, and snippets.

@scattered-code
Created September 21, 2020 01:47
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 scattered-code/8839155590a93e862365ca1f4a7cffba to your computer and use it in GitHub Desktop.
Save scattered-code/8839155590a93e862365ca1f4a7cffba to your computer and use it in GitHub Desktop.
var boundary = RequestHelpers.GetBoundary(_httpContextAccessor.HttpContext.Request.ContentType);
var reader = new MultipartReader(boundary, _httpContextAccessor.HttpContext.Request.Body);
var section = await reader.ReadNextSectionAsync();
var fileSection = section.AsFileSection();
var originalFilename = fileSection.FileName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment