Copy large files with Microsoft Flow

When you work with large files in Microsoft Flow you will find that there are some things that you need to consider. In this post I’m looking at a few common issues.

General setup

I’ve created a document library to which I upload a very large file.

My flow identifies that a file is being uploaded and on creation my flow starts. Note that my file is still uploading at this time.

Get file content file size limits

After a while I get the following error when I try to get the content

BadRequest. Http request failed as there is an error: ‘Cannot write more bytes to the buffer than the configured maximum buffer size: 104857600.’.

I then made my file slightly smaller.

Create file, file size limits

Once I uploaded a slightly smaller but still large file my get file content worked fine, but now when I tried to create anew file with the content I got a RequestEntityTooLarge.

In the details I was given a 413 error with the description of The request is larger than 94371840 bytes.

Copy file

As I’m trying to copy a file with the get file content and create file actions I could also consider the copy file action.

The copy file action simply works. Why? the answer is quite simple. The API is struggling when we first collect all the content of the file and then send the content back through the two actions. This means that the content of the file will twice travel between Flow and SharePoint. When a copy file is used only a file reference is sent.

 

Advertisements

One thought on “Copy large files with Microsoft Flow

  1. Thank you so much for this. This is very timely info as I’m working on my first Flow to copy/create files uploaded from PowerApps to a SharePoint list into a document library.

    Liked by 1 person

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.