I am using following code to perform download in MVC:
CONTROLLER:
public ActionResult Download(string SysID)
{
try
{
byte[] fileData = Get Data in Byte array;
if (fileData != null)
{
string fileName = "Mytest.bin";
return File(fileData, "application/octet-stream", fileName);
}
else
return null;
}
catch (Exception ex)
{
throw ex;
}
}
Everything is working fine using above code. I am able to generate .bin file and successfully downloaded.
Problem:
How i can wrap this in zip file using SharpZipLib? I am restricted to use SharpZipLib. Reason behind this is i need to send this file to other systems where we are already using SharpZipLib to unzip files.
Please let me know if more info required, i will try my best to provide more information.
Thanks in advance.