I have file in the form of binary array and i need the browser to open a download dialogue and save the file.
i tried
Response.BinaryWrite(fileData);
but it just added the binary character to the page and didn't open a download dialogue!
I have file in the form of binary array and i need the browser to open a download dialogue and save the file.
i tried
Response.BinaryWrite(fileData);
but it just added the binary character to the page and didn't open a download dialogue!
You need also to set the content type:
Response.ContentType = "application/octet-stream";
Try this:
Response.Clear();
Response.AppendHeader("content-disposition", "attachment; filename=fileToDownload");
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(fileData);
Response.Flush();
Response.End();