IFormFile IFormFile Interface

Represents a file sent with the HttpRequest.

Syntax

Declaration

public interface IFormFilePublic Interface IFormFile

Properties summary

Gets the raw Content-Disposition header of the uploaded file.
Gets the raw Content-Type header of the uploaded file.
Gets the file name from the Content-Disposition header.
Gets the header dictionary of the uploaded file.
Gets the file length in bytes.
Gets the name from the Content-Disposition header.

Methods summary

Copies the contents of the uploaded file to the target stream.
Asynchronously copies the contents of the uploaded file to the target stream.
Opens the request stream for reading the uploaded file.

Properties

  • ContentDisposition
    ContentDisposition
    Gets the raw Content-Disposition header of the uploaded file.
    string ContentDisposition { get; }ReadOnly Property ContentDisposition As String

    Property Value

    • System.String
      System.String
  • ContentType
    ContentType
    Gets the raw Content-Type header of the uploaded file.
    string ContentType { get; }ReadOnly Property ContentType As String

    Property Value

    • System.String
      System.String
  • FileName
    FileName
    Gets the file name from the Content-Disposition header.
    string FileName { get; }ReadOnly Property FileName As String

    Property Value

    • System.String
      System.String
  • Headers
    Headers
    Gets the header dictionary of the uploaded file.
    IHeaderDictionary Headers { get; }ReadOnly Property Headers As IHeaderDictionary

    Property Value

  • Length
    Length
    Gets the file length in bytes.
    long Length { get; }ReadOnly Property Length As Long

    Property Value

    • System.Int64
      System.Int64
  • Name
    Name
    Gets the name from the Content-Disposition header.
    string Name { get; }ReadOnly Property Name As String

    Property Value

    • System.String
      System.String

Methods

  • CopyTo(Stream)
    CopyTo(Stream)
    Copies the contents of the uploaded file to the target stream.
    void CopyTo(Stream target)Sub CopyTo(target As Stream)

    Parameters

    • target
      System.IO.Stream
      System.IO.Stream
      The stream to copy the file contents to.
  • CopyToAsync(Stream, CancellationToken)
    CopyToAsync(Stream, CancellationToken)
    Asynchronously copies the contents of the uploaded file to the target stream.
    Task CopyToAsync(Stream target, CancellationToken cancellationToken = null)Function CopyToAsync(target As Stream, cancellationToken As CancellationToken = Nothing) As Task

    Parameters

    • target
      System.IO.Stream
      System.IO.Stream
      The stream to copy the file contents to.
    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

    Returns

    • System.Threading.Tasks.Task
      System.Threading.Tasks.Task
  • OpenReadStream()
    OpenReadStream()
    Opens the request stream for reading the uploaded file.
    Stream OpenReadStream()Function OpenReadStream As Stream

    Returns

    • System.IO.Stream
      System.IO.Stream

Details

Assembly

Microsoft.AspNetCore.Http.Features.dll