I have a WCF Service that returns a byte array with a ZIP file (50MB) to any client that requests it. If the zip is very small (say 1MB), the soap response is coming from WCF with the byte array embedded in it.But the response size is very huge even for a 1MB file. If i try the 50MB file to get transferred the Service gets hanged and throws out of memory exception, because the SOAP response becomes huge in size.
What is the best option available with WCF/Web Service to trasnfer large files (mainly ZIP format) as iam sending back byte array. Instead of that any good approach for sending back the file?
Whether WCF/Web Service is best way to transfer large files to any client or any other better option/technology avlbl so that interoperability and scalability for 10000 users can be achieved?
My Code is below
String pathfordownload = @"D:\New Folder.zip";
FileStream F2D = new FileStream(pathfordownload, FileMode.Open,FileAccess.Read);
BinaryReader binReader = new BinaryReader(F2D);
binReader.BaseStream.Position = 0;
byte[] binFile = binReader.ReadBytes(Convert.ToInt32 (binReader.BaseStream.Length));
binReader.Close();
return binFile;
A working piece/real piece of information will be really helpful as iam struggling with all the data available in google and no good results for last 1 week. Thanks in advance