Hi All,

I am trying to download a text file around 2KB from the server onto the client using ASP.NET

The downloaded file is incomplete 500bytes only

The code is as below:

Response.ContentType = "text/plain"; // Set the file content type to text
Response.Clear();
Response.Buffer = true;
Response.Charset = ""; // Remove the charset from the Content-Type header.
this.EnableViewState = false; //Turn off the view state.

Response.AppendHeader( "Content-Disposition","attachment; filename=FileName.txt" );
Response.AppendHeader( "Content-Length", strFileName.Length.ToString() );
Response.WriteFile( "Filename.txt" ); // Write the contents of file to client
Response.Flush();
Response.End()

Can anyone tell me what is going wrong.

Any help is appreciated.