question

HPrakash-1756 avatar image
0 Votes"
HPrakash-1756 asked Deva-MSFT commented

download outlook attachment via api in angular 10

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(mail.id, 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')
.get();
return result;
} catch (error) {
console.log(error);
}
}

microsoft-graph-mail
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @HPrakash-1756,

Welcome to our forum.

Please kindly understand under Outlook tag, we mainly focus on general issue on Outlook desktop client, considering your issue may be more related to mail api, I removed outlook tag and add api tag, thanks for your understanding and hope your issue would be resolved soon.

0 Votes 0 ·
  • Please share the detailed error id that you're receiving (along with requestid, timestamp)

0 Votes 0 ·

0 Answers