我有这个代码在这里我使用 EWS 从 Exchange 服务器上的电子邮件中检索附件
Attachment attachment = message.Attachments.Single(att => att.ContentId == Request.QueryString["cid"]);
attachment.Load();
FileAttachment fileAttachment = attachment as FileAttachment;
fileAttachment.Load();
byte[] bytes = fileAttachment.Content;
Stream theMemStream = new MemoryStream();
theMemStream.Write(bytes, 0, bytes.Length);
return new FileStreamResult( theMemStream, attachment.ContentType);
我可以很好地下载文件,但是它们已损坏...我缺少什么吗?