HttpResponseWrapper.TransmitFile Method

Definition

Writes the specified file to the HTTP response output stream, without buffering it in memory.

Overloads

TransmitFile(String, Int64, Int64)

Writes the specified part of a file to the HTTP response output stream, without buffering it in memory.

TransmitFile(String)

Writes the specified file to the HTTP response output stream, without buffering it in memory.

TransmitFile(String, Int64, Int64)

Writes the specified part of a file to the HTTP response output stream, without buffering it in memory.

C#
public override void TransmitFile(string filename, long offset, long length);

Parameters

filename
String

The name of the file to write to the HTTP output stream.

offset
Int64

The position in the file where writing starts.

length
Int64

The number of bytes to write, starting at offset.

Exceptions

The offset parameter is less than zero.

-or-

The length parameter is less than -1.

-or-

The length parameter is greater than the file size minus offset.

The out-of-process worker request is not supported.

-or-

The response is not using a HttpWriter object.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

TransmitFile(String)

Writes the specified file to the HTTP response output stream, without buffering it in memory.

C#
public override void TransmitFile(string filename);

Parameters

filename
String

The name of the file to write to the HTTP output stream.

Exceptions

filename is null

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1