HttpResponse.TransmitFile Método
Definição
Grava o arquivo especificado diretamente em um fluxo de saída de resposta HTTP, sem armazená-lo em buffer na memória.Writes the specified file directly to an HTTP response output stream without buffering it in memory.
Sobrecargas
| TransmitFile(String, Int64, Int64) |
Grava a parte especificada de um arquivo diretamente em um fluxo de saída de resposta HTTP, sem armazená-lo em buffer na memória.Writes the specified part of a file directly to an HTTP response output stream without buffering it in memory. |
| TransmitFile(String) |
Grava o arquivo especificado diretamente em um fluxo de saída de resposta HTTP, sem armazená-lo em buffer na memória.Writes the specified file directly to an HTTP response output stream, without buffering it in memory. |
TransmitFile(String, Int64, Int64)
Grava a parte especificada de um arquivo diretamente em um fluxo de saída de resposta HTTP, sem armazená-lo em buffer na memória.Writes the specified part of a file directly to an HTTP response output stream without buffering it in memory.
public:
void TransmitFile(System::String ^ filename, long offset, long length);
public void TransmitFile (string filename, long offset, long length);
member this.TransmitFile : string * int64 * int64 -> unit
Public Sub TransmitFile (filename As String, offset As Long, length As Long)
Parâmetros
- filename
- String
O nome do arquivo no qual a saída HTTP será gravada.The name of the file to write to the HTTP output.
- offset
- Int64
A posição no arquivo para começar a gravar a saída HTTP.The position in the file to begin to write to the HTTP output.
- length
- Int64
O número de bytes a serem transmitidos.The number of bytes to be transmitted.
Exceções
O parâmetro offset é menor que zero.The offset parameter is less than zero.
- ou --or-
O parâmetro length é menor que -1.The length parameter is less than -1.
- ou --or-
O parâmetro length especifica um número de bytes maior do que o número de bytes que o arquivo contém menos o deslocamento.The length parameter specifies a number of bytes that is greater than the number of bytes the file contains minus the offset.
Não há suporte para a solicitação de trabalho fora de processo.The out-of-process worker request is not supported.
- ou --or-
A resposta não está usando um objeto HttpWriter.The response is not using an HttpWriter object.
O parâmetro offset é menor que zero ou maior que o tamanho do arquivo.The offset parameter is less than zero or greater than the file size.
- ou --or-
O parâmetro length é menor que -1 ou maior ou igual ao valor do parâmetro offset mais o tamanho do arquivo.The length parameter is less than -1 or greater than the value of the offset parameter plus the file size.
Comentários
Se você especificar 0 como o offset parâmetro e-1 como o length parâmetro, todo o arquivo será enviado.If you specify 0 as the offset parameter and -1 as the length parameter, the whole file is sent.
Aplica-se a
TransmitFile(String)
Grava o arquivo especificado diretamente em um fluxo de saída de resposta HTTP, sem armazená-lo em buffer na memória.Writes the specified file directly to an HTTP response output stream, without buffering it in memory.
public:
void TransmitFile(System::String ^ filename);
public void TransmitFile (string filename);
member this.TransmitFile : string -> unit
Public Sub TransmitFile (filename As String)
Parâmetros
- filename
- String
O nome do arquivo no qual a saída HTTP será gravada.The name of the file to write to the HTTP output.
Exceções
O parâmetro filename é nullThe filename parameter is null