I am working on ASP.Net MVC 4.7 project, in which I am using Microsoft graph api to send mail. I want to know what is the contentByte. How I can get it from the filestream. See the following code. I am searching for
fileAttachment.ContentBytes=
Note that files are in stream they are uploaded by the user.
private static MessageAttachmentsCollectionPage GetAttachments(List<HttpPostedFileBase> fileUploader)
{
var attachmentPage = new MessageAttachmentsCollectionPage();
if (fileUploader != null)
{
foreach (var file in fileUploader)
{
var fileAttachment = new FileAttachment();
fileAttachment.Name = file.FileName;
fileAttachment.ContentType = file.ContentType;
fileAttachment.ContentBytes = ??
attachmentPage.Add(fileAttachment);
}
}