Results.File 메서드

정의

오버로드

File(Byte[], String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue)

바이트 배열 콘텐츠를 응답에 씁니다.

범위 요청(Status206PartialContent 또는 Status416RangeNotSatisfiable 범위가 만족스럽지 않은 경우)을 지원합니다.

이 API는 의 Bytes(Byte[], String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue)별칭입니다.

File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

지정된 Stream 를 응답에 씁니다.

범위 요청(Status206PartialContent 또는 Status416RangeNotSatisfiable 범위가 만족스럽지 않은 경우)을 지원합니다.

이 API는 의 Stream(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)별칭입니다.

File(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

지정된 path 의 파일을 응답에 씁니다.

범위 요청(Status206PartialContent 또는 Status416RangeNotSatisfiable 범위가 만족스럽지 않은 경우)을 지원합니다.

File(Byte[], String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue)

바이트 배열 콘텐츠를 응답에 씁니다.

범위 요청(Status206PartialContent 또는 Status416RangeNotSatisfiable 범위가 만족스럽지 않은 경우)을 지원합니다.

이 API는 의 Bytes(Byte[], String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue)별칭입니다.

public static Microsoft.AspNetCore.Http.IResult File (byte[] fileContents, string? contentType = default, string? fileDownloadName = default, bool enableRangeProcessing = false, DateTimeOffset? lastModified = default, Microsoft.Net.Http.Headers.EntityTagHeaderValue? entityTag = default);
static member File : byte[] * string * string * bool * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Http.IResult
Public Shared Function File (fileContents As Byte(), Optional contentType As String = Nothing, Optional fileDownloadName As String = Nothing, Optional enableRangeProcessing As Boolean = false, Optional lastModified As Nullable(Of DateTimeOffset) = Nothing, Optional entityTag As EntityTagHeaderValue = Nothing) As IResult

매개 변수

fileContents
Byte[]

파일 내용입니다.

contentType
String

파일의 Content-Type입니다.

fileDownloadName
String

제안된 파일 이름입니다.

enableRangeProcessing
Boolean

범위 요청 처리를 사용하도록 설정하려면 로 true 설정합니다.

lastModified
Nullable<DateTimeOffset>

DateTimeOffset 파일이 마지막으로 수정된 시기의 입니다.

entityTag
EntityTagHeaderValue

EntityTagHeaderValue 파일과 연결된 입니다.

반환

응답에 대해 만들어진 IResult 입니다.

적용 대상

File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

지정된 Stream 를 응답에 씁니다.

범위 요청(Status206PartialContent 또는 Status416RangeNotSatisfiable 범위가 만족스럽지 않은 경우)을 지원합니다.

이 API는 의 Stream(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)별칭입니다.

public static Microsoft.AspNetCore.Http.IResult File (System.IO.Stream fileStream, string? contentType = default, string? fileDownloadName = default, DateTimeOffset? lastModified = default, Microsoft.Net.Http.Headers.EntityTagHeaderValue? entityTag = default, bool enableRangeProcessing = false);
static member File : System.IO.Stream * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Http.IResult
Public Shared Function File (fileStream As Stream, Optional contentType As String = Nothing, Optional fileDownloadName As String = Nothing, Optional lastModified As Nullable(Of DateTimeOffset) = Nothing, Optional entityTag As EntityTagHeaderValue = Nothing, Optional enableRangeProcessing As Boolean = false) As IResult

매개 변수

fileStream
Stream

Stream 파일의 내용이 포함된 입니다.

contentType
String

파일의 Content-Type입니다.

fileDownloadName
String

헤더에 사용할 파일 이름입니다 Content-Disposition .

lastModified
Nullable<DateTimeOffset>

DateTimeOffset 파일이 마지막으로 수정된 시기의 입니다. 응답 헤더를 Last-Modified 구성하고 조건부 범위 요청을 수행하는 데 사용됩니다.

entityTag
EntityTagHeaderValue

EntityTagHeaderValue 응답 헤더를 ETag 구성하고 조건부 요청을 수행할 입니다.

enableRangeProcessing
Boolean

범위 요청 처리를 사용하도록 설정하려면 로 true 설정합니다.

반환

응답에 대해 만들어진 IResult 입니다.

설명

fileStream 응답이 전송된 후 매개 변수가 삭제됩니다.

적용 대상

File(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

지정된 path 의 파일을 응답에 씁니다.

범위 요청(Status206PartialContent 또는 Status416RangeNotSatisfiable 범위가 만족스럽지 않은 경우)을 지원합니다.

public static Microsoft.AspNetCore.Http.IResult File (string path, string? contentType = default, string? fileDownloadName = default, DateTimeOffset? lastModified = default, Microsoft.Net.Http.Headers.EntityTagHeaderValue? entityTag = default, bool enableRangeProcessing = false);
static member File : string * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Http.IResult
Public Shared Function File (path As String, Optional contentType As String = Nothing, Optional fileDownloadName As String = Nothing, Optional lastModified As Nullable(Of DateTimeOffset) = Nothing, Optional entityTag As EntityTagHeaderValue = Nothing, Optional enableRangeProcessing As Boolean = false) As IResult

매개 변수

path
String

파일의 경로입니다. 루트되지 않은 경우 은 에 상대적인 경로를 확인합니다 WebRootFileProvider.

contentType
String

파일의 Content-Type입니다.

fileDownloadName
String

제안된 파일 이름입니다.

lastModified
Nullable<DateTimeOffset>

DateTimeOffset 파일이 마지막으로 수정된 시기의 입니다.

entityTag
EntityTagHeaderValue

EntityTagHeaderValue 파일과 연결된 입니다.

enableRangeProcessing
Boolean

범위 요청 처리를 사용하도록 설정하려면 로 true 설정합니다.

반환

응답에 대해 만들어진 IResult 입니다.

적용 대상