Hi All,
Is there a way of saving a System.Net.Attachment directly into a database field without writing to disk?
I am using LINQ and this is what I have for now:
AttachmentDetail attd = new AttachmentDetail();
attd.HeaderID=atth.ID;
attd.FileName = att.ContentDisposition.FileName;
attd.Object = ? //Something to put here...
Thanks and Regards
Loading
Glenn SanchezPosted Mar 27, 2012, 7:34 AM
Glenn SanchezPosted Mar 27, 2012, 3:48 AM
AttachmentDetail attd = new AttachmentDetail();
attd.HeaderID=atth.ID;
attd.FileName = att.ContentDisposition.FileName;
byte[] data = new byte[att.ContentStream.Length];
att.ContentStream.Read(data,0,Convert.ToInt32(att.ContentStream.Length));
attd.Object = data.ToArray();
I can only confirm after I finish the thread that translates these attachments to a file.
regards