Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface Microsoft.​AspNetCore.​Http.​IFormFile

Assembly: Microsoft.AspNetCore.Http.Features

Represents a file sent with the HttpRequest.

Properties

string
ContentType
Gets the raw Content-Type header of the uploaded file.
string
ContentDisposition
Gets the raw Content-Disposition header of the uploaded file.
Gets the header dictionary of the uploaded file.
long
Length
Gets the file length in bytes.
string
Name
Gets the form field name from the Content-Disposition header.
string
FileName
Gets the file name from the Content-Disposition header.

Methods

OpenReadStream​()
Opens the request stream for reading the uploaded file.
void
CopyTo​(System.​IO.​Stream target)
Copies the contents of the uploaded file to the <paramref name="target" /> stream.
target The stream to copy the file contents to.
CopyToAsync​(System.​IO.​Stream target, System.​Threading.​CancellationToken cancellationToken = null)
Asynchronously copies the contents of the uploaded file to the <paramref name="target" /> stream.
target The stream to copy the file contents to.