download outlook attachment via api in angular 10

HPrakash 1 Reputation point

I am trying to access outlook mail api and trying to download attachment in mails. For smaller attachments, it works fine. For something more than 1MB it just fails.

async downloadAttachment(mail: ET.IOutlookMailItem, att: ET.IOutlookMailAttachment) {

this.graphService.getRawAttachment(, att.attachmentId).then(resp => {
// saveAs is from file-saver for blob saving
saveAs(resp, att.attachmentName);

async getRawAttachment(messageid: string, attachmentid: string): Promise<any> {
try {
let result = await this.graphClient
.api('/me/messages/' + messageid + '/attachments/' + attachmentid + '/$value')
return result;
} catch (error) {

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,420 questions
{count} votes