Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Gateway attachment size limit

HI All 


I have a flow that scraps an email for text and attachments. Then passes through an on-premises gateway to an internal api using a custom connector. 

This process completes fine as long as the attachment is under 3 Mb.  If the attachment is over I receive the following error, 



  "message""The request content-length is larger than '3182218' bytes. Current: '5046177' bytes.\r\nclientRequestId:  ***",
  "error": {
    "message""The request content-length is larger than '3182218' bytes. Current: '5046177' bytes." 
The API is successful using swagger internally with the larger attachment.
Is there a config file somewhere that restricts large file passing through the gateway, or am I on the wrong track.
Continued Contributor
Continued Contributor

Did you ever solve this issue? I am having the exact same issue. 

HI FoDelement

No, I couldn't find any information to increase the limit. I ended up checking for attachment size and then landing the large files on an internal server (can pass these through the gateway to a file system but not to the api call...) along with a powershell script that was dynamically created with the api details. In the flow i ran a desktop flow ( unattended, need another licence for this) that ran the powershell script to call the api and upload the attachment, then delete both files. 

Its a long way around but it works. 

Hey Mate @bevanmedley 


There is a limit on the Gateway attachment size limit. 




If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hey CFernandes


Thanks for the info, I did end up finding the limit but unfortunately no way to increase it.




Hello @bevanmedley 


I hope you have upvoted the Idea.  

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,959)