I would like to know why after downloading a file from a Web-Server (the last line of the *.hex file does not contain anything, it is just an empty line) it saves the last line of the new file with NULL which increases the size of my *.hex file:
byte[] buffer = null;
using (FileStream fs = new FileStream("Drive of the server: //download.hex", FileMode.Open, FileAccess.Read))
{
buffer = new byte[fs.Length];
fs.Read(buffer, 0, (int)fs.Length);
}
var cd = new System.Net.Mime.ContentDisposition
{
FileName = "Fresh_copy_of_the_file" + ".hex",
Inline = false,
};
Response.AppendHeader("Content-Disposition", cd.ToString());
return File(buffer, "application/octet-stream");