Response.WriteFile() giving an extra byte at the end?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: David Union (d.union_at_verizon.net)
Date: 09/01/04


Date: Wed, 1 Sep 2004 18:03:28 -0400

Hi.
I'm posting this here because I don't know exactly what the best group is.
This is for an aspx page with Visual Basic as the code-behind page.

I am doing very simple code...
in the middle of an http request, i set a filename (with path)
and do a Response.WriteFile(filenamewithpath)
then Response.End().

I have tried Response.Clear() and .Flush() ahead of time.

I have tried various permutations (all, I think) of Content-Type
and Content-Disposition.

I have also tried opening a file stream and copying the data
to an array of bytes (the data is good in the array) and then
doing a Response.BinaryWrite(binaryarray)
then Response.End().

I've also tried Response.Close().

In all cases I get an extra byte at the end of the file,
so the CRC doesn't match up.

Anyone know the solution for this?

Windows 2000 Server, Visual Studio 2003
with the appropriate and updated framework.

Thanks,
DU



Relevant Pages

  • Re: Response.WriteFile seems to be adding an extra byte
    ... > in the middle of an http request, i set a filename ... > I have tried various permutations of Content-Type ... > I have also tried opening a file stream and copying the data ... > to an array of bytes and then ...
    (microsoft.public.dotnet.languages.vb)
  • Response.WriteFile seems to be adding an extra byte
    ... I have tried various permutations of Content-Type ... I have also tried opening a file stream and copying the data ... to an array of bytes and then ... Windows 2000 Server, Visual Studio 2003 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: reading after xmlHTTP.responseText ?
    ... Not sure you can treat the HTTP response in the same way as a file stream. ... Try creating an array of lines using Splitand then looping through the ... dim arrLines ...
    (microsoft.public.scripting.vbscript)
  • Re: Text or character find in TFileStream
    ... Tomaz Koritnik wrote in article ... Just read block by block (a block is array of char for example) ... > file stream using TFileStream.Readand scan each block for characters. ...
    (borland.public.delphi.non-technical)
  • Re: Displaying images stored as binary in MySQL
    ... > You must use '\r\n' to terminate header lines. ... is that the binary data is in a array. ...
    (comp.lang.python)