question

AmitShimon-8278 avatar image
0 Votes"
AmitShimon-8278 asked saldana-msft edited

currpeted files

Hi, I work on an application that integrates with outlook mails and displays it on my site, I have a feature that allows the user to download and upload files from email attachments.
when the user tries to download and then upload to his drive the file is corrupted.

I am uploading the buffer array that I am getting from the attachment endpoint

https://graph.microsoft.com/v1.0/users/${from}/messages/${messageId}/attachments/${attachmentId}/$value

I can't find why the file is corrupted, I have checked multiple times and I pass the same array as I am getting from the attachments endpoint

this is how my upload request looks like :
const response = await axios.put(
https://graph.microsoft.com/v1.0/${where}/drive/root:/${path}/${name}:/content?@microsoft.graph.conflictBehavior=rename,
item,
{
headers: {
Authorization: Bearer ${token},
'Content-Type':fileContentType,
},
}
);

microsoft-graph-mailmicrosoft-graph-files
· 1
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.

I would try the following to isolate the issue:

  • User downloads the email. Make it opens correctly with Outlook, so that you can confirm its in good shape

  • After validation ask the user/your app to upload it in the onedrive

  • Wait till the file successfully uploaded in Onedrive and then make the API call. Observe still you the file corruption or not.

0 Votes 0 ·

0 Answers