I have this following code for bringing page attachments to the user:
private void GetFile(string package, string filename) { var stream = new MemoryStre
You should not use stream.GetBuffer() because it returns the buffer array which might contain unused bytes. Use stream.ToArray() instead. Also, have you tried calling stream.Seek(0, SeekOrigin.Begin) before writing anything?
stream.GetBuffer()
stream.ToArray()
stream.Seek(0, SeekOrigin.Begin)
Best Regards, Oliver Hanappi