Hi all.
Years ago a followed a sample to export PDF files. It saves them to the local [webservice] server then sends them back as Base64 with he following lines.
BinaryReader binReader = new BinaryReader(File.Open(strLocalFile, FileMode.Open, FileAccess.Read));
binReader.BaseStream.Position = 0;
byte[] binFile = binReader.ReadBytes(Convert.ToInt32(binReader.BaseStream.Length));
binReader.Close();
return binFile;
However while researching how to export a single JPG; I kept seeing reference to a "MemoryStream". My impression is that this could take [(exporter.ExportPage(docInfo, 1, strLocalFile);] and with less steps send it right back to the requester as a JPG? However no code samples were complete.
So is there a better way to send things back? Can I use memorystream like I am thinking? Send a jpg directly when called? Maybe even not saving it to the local drive first??
What I've been doing works, but that doesn't mean I've been doing right/best.
Thanks for any input.