static List DownloadDocumentContent(Document document) { List objReturn = new List(); if (document.FileDownloadRelationLink == null) document = document.GetDocumentFromSelfRelation(); foreach (var sec in document.Sections) { try { Section downloadResponse = sec.GetSectionFromSelfRelation(); var streamSection = downloadResponse.GetStreamFromFileDownloadRelationAsync(); var contentHeaders = streamSection.Result.ContentHeaders; objReturn.Add(new FileDownloadResult() { Stream = streamSection.Result, FileName = contentHeaders.ContentDisposition.FileName == null ? contentHeaders.ContentDisposition.FileNameStar.Replace('\"', ' ').Trim() : contentHeaders.ContentDisposition.FileName.Replace('\"', ' ').Trim() }); } catch(Exception ex) { } } return objReturn; }