Microsoft-graph-docs: Attachments > 4 MB?

Created on 11 Apr 2019  Â·  12Comments  Â·  Source: microsoftgraph/microsoft-graph-docs

"Since there is currently a limit of 4MB on the total size of each REST request, this limits the size of the attachment you can add to under 4MB."
Could the doc give pointers on what to do best if some email must have an attachment file of, let's say, 5 MB?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Most helpful comment

We are almost ready for you. We are weeks away from a beta release.

All 12 comments

In my project (for a large home care provider) I need the same, because 4 MB really isn't enough and leads to quite a lot of operational issues. So I hope this will be fixed soon (let's say to 8 or 10 MB)!

I use outlook api if it is bigger then 4 mb here is my testcode:
(permission scope for the access token is "scope", "https://outlook.office.com/mail.readwrite" )
private async Task UploadUsingOutlookApi(string accessToken, string payload)
{
var request = new HttpRequestMessage(HttpMethod.Post, "https://outlook.office.com/api/v2.0/me/MailFolders/drafts/messages");
request.Headers.Add("Authorization", $"bearer {accessToken}");
var requestContent = new StringContent(payload);
requestContent.Headers.Remove("Content-Type");
requestContent.Headers.Add("Content-Type", "application/json");
request.Content = requestContent;
var client = new HttpClient();
return await client.SendAsync(request);
}

    private string GeneratePayload(string fileName, string fileEncoded)
    {
        var jMessage = new JObject();
        var jAttachments = new JArray();
        var jAttachment = new JObject
        {
            {"@odata.type", "#Microsoft.OutlookServices.FileAttachment"},
            {"Name", fileName},
            {"ContentBytes", fileEncoded}
        };
        jAttachments.Add(jAttachment);
        jMessage.Add("Attachments", jAttachments);
        return jMessage.ToString();
    }

This is related to #3593, which was closed since this is supposedly a feature request and you should vote for this on uservoice.

Also related to #85, but that one was closed as well since we needed to follow-up in issue #3593...

This appears to be that way of MS (or, at least, of @svpsiva and his group) of making it appear that they are working hard. Start a new thread every once in a while and pretend that work has just started. The reality is that this so-called work and what should really be a minor fix (change the number 4 to 25 in the MB if the original code was written well) has been pretending to be going on for years (if you see #85 and #3593). Any other organization would fire @svpsiva but I guess he is some "Senior Program Manager" of incompetence. This is beyond disgusting!

@maitra I appreciate your passion and desire for this to be shipped.

But you have no right making personal attacks on any of the team on Microsoft Graph. You have no idea what our priorities look like at Microsoft or the complexities of our platform and design choices.

In future I would encourage you to stay positive and provide feedback that will help us to prioritize our backlog.

I fail to understand what aspect of my comments constituted a "personal attack" but I do understand why it is easy to shift attention than actually solve the issue that users have paid for.

And you may well be right that we have no idea of the complexities of your platform or design choices. Many of it is needless, and perhaps poorly programmed (the massive changes presumed to be required and being worked on for years to increase the 4MB limit seems to indicate arbitrary coding). In any case most of it is tried on consumers as test beds without caring for them: why else would you recommend the use of MS Graph when it is clearly not ready with such an arbitrarily low limit?

But I am glad to report that we are moving away from MS Crap and to a different provider who we hope will be more responsive and do less harm.

On behalf of our clients who have been asking, are there any updates on this issue?

We are almost ready for you. We are weeks away from a beta release.

This is becoming critical as Microsoft PowerPlatform (Flow/PowerApps) is deprecating the Outlook REST API (It appears to be happening this month) in favor for the Graph API when connecting to Outlook 365.
https://flow.microsoft.com/en-us/blog/office-365-outlook-connector-important-upcoming-changes/

Now user and business flows and PowerApps that deal file attachments are breaking in odd and unexpected ways.

The Graph API should at least be able to handle messages that conform the smallest limits per:
https://docs.microsoft.com/en-us/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#message-limits-across-office-365-options
which would be 25MB total message size for legacy encryption system "Size limit for encrypted messages (for subscribers using Office 365 Message Encryption legacy version)5"

Please vote for https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests/suggestions/37353598-send-message-with-a-larger-than-3-mb-file-attachm

Thanks!

@svpsiva This is still in beta?...https://developer.microsoft.com/en-us/office/blogs/attaching-large-files-to-outlook-messages-in-microsoft-graph-preview/
any plans to move it to use for production?

@kishor1910 , you can now attach files up to 150MB in size to message and event resources on the v1 endpoint, good for production apps.
If you're interested - there's a weekly roll up of what's new in the docs. The large file attachment update came in April.
Heads-up - that what's new topic features the two most recent months at a time. As we get into June, April updates will go to highlights of earlier releases any time now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abhatt29 picture abhatt29  Â·  4Comments

shyamkris picture shyamkris  Â·  3Comments

nilleb picture nilleb  Â·  4Comments

bijithbalan picture bijithbalan  Â·  4Comments

findyoucef picture findyoucef  Â·  4Comments