memory stream file reading
-
Hi. I need help reading a file which is created via memory stream. I know how to read a file (in byte array form) and write to memory stream, but i need to attach this file from the memory stream and email it. I am doing this to remove the hassles of reading and writing files to disk. Any help is greatly appreciated. Thanks
-
Hi. I need help reading a file which is created via memory stream. I know how to read a file (in byte array form) and write to memory stream, but i need to attach this file from the memory stream and email it. I am doing this to remove the hassles of reading and writing files to disk. Any help is greatly appreciated. Thanks
-
Just create the attachment from the stream:
Attachment a = new Attachment(theMemoryStream);
The constructor also has overloads so that you can specify file name and mime type.Despite everything, the person most likely to be fooling you next is yourself.