Archive a large SharePoint folder into a zip file and store to another SharePoint site

Andrew Long | DaniHar Technology 20 Reputation points
2025-01-29T14:50:20.7133333+00:00

Hi, I have a use case in the business where I need to archive into a zip file a project folder which could be 500+MB which will reside on a SharePoint project site to another project repository site. This zip file will then be version-controlled with a tag (comment).
I'd like to do this as a power automate flow. I have managed to create such a flow with help from an online resource for smaller project folders <100MB. I understand that this is a restriction of an HTTP request, anything greater the flow fails.

I have read up and experimented with the possibilities of using Graph API implementing the following in a power automate flow and have achieved the following:

  • Get Site ID
  • Get Drive ID
  • Get File Info for each file in all folders, e.g. name, full path, size, ID, etc

Having got the list of all the files, I understand that I need to create an upload session for each file and upload the contents in chunks. However, once uploaded all the files, I don't know how to transform to a single zip file and specify the destination folder.

My previous flow using simple HTTP request for smaller folder size followed this flow and used a transform to zip:

User's image

Can anyone help to advise how or if this could be achieved using the Graph API?

Many thanks.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,910 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,148 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
622 questions
0 comments No comments
{count} votes

Accepted answer
  1. Saranya Madhu-MSFT 1,255 Reputation points Microsoft Vendor
    2025-01-30T05:12:38.68+00:00

    Hi Andrew Long | DaniHar Technology,

    Thanks for reaching out to Microsoft!

    Currently Graph API does not directly support creating zip files. Since this feature/functionality is presently not available, you can submit a feature request idea using this support link, which will be monitored by Microsoft team and make the enhancements to Microsoft Graph APIs. I will also upvote for you.

    You can create the zip file locally or on a server before uploading it to the destination folder. Once you have the zip file, you can upload it to the destination folder in SharePoint using the Graph API.

    As mentioned in document, Use Graph API for the file size up to 250 MB.

    PUT /users/{user-id}/drive/items/{parent-id}:/{filename}:/content 
    

    If the file size exceeds 250MB, Create an upload session to allow your app to upload files up to the maximum file size. An upload session allows your app to upload ranges of the file in sequential API requests

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.