c# - Sending Binary Data problem -
I am trying to send binary data from the database to an ASP.Net page. I can see that property data.landa is 2400, that means 2400 bytes, right? The strange thing is that when I get this data, the size is ~ 4kb, and appears to be corrupt. What can be any problem?
byte [] data = proxy .get data (id); Response.Clear (); Response.AddHeader ("content-displacement", "attachment; file name = data.bin"); Response.AddHeader ("content-length", data-length.tostring ()); Response.ContentType = "app / octet-stream"; Response.Write (data); Response.Flush ();
There are only 4 overloads of the response. Type:
write public zero (four f); Write public null (object obj); Write public null (string s); Public Zero Write (four [buffer, int index, int count];
And I suspect that, your code ( response. (Data)
) Based on this, you are calling
feedback. BinaryWrite (data);
This is specifically to write content of the byte array in the output stream.
Comments
Post a Comment