How to consistently upload ZIP files to SharePoint

Mongoose 36 Reputation points
2021-10-05T15:59:34.957+00:00

I am uploading zipped files to SharePoint. More than half become corrupt in the upload process. I am unable to open them within the SharePoint site. If I download one of these that will not open in the site, the downloaded version is corrupt. The original version prior to upload is fine. I have tried using the web GUI to upload. I have tried using Add-PnPFile via a PowerShell script. I have tried mapping a drive to the SharePoint location and using File Explorer. I have tried the copy command with the mapped drive. RoboCopy will not work because the FileSizeLimitInBytes registry entry cannot exceed 999999999. This limits it to roughly 1 GB. Most of these files are between 1 and 20 GB, although they can be larger. Size does not seem to matter, however, as I have successfully uploaded files exceeding 11 GB while some of the failed ones are only 1 GB.
The purpose of the files is to archive user files for separated employees. When a user leaves the company, the files from the user's OneDrive account are downloaded and zipped into a file. This is necessary because the files will be deleted from OneDrive a few months after the user's Microsoft licenses have been revoked. I suppose we could simply upload the original files to SharePoint, but that seems like a lot of wasted space.
Any suggestions will be greatly appreciated.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,621 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. JoyZ 18,041 Reputation points
    2021-10-06T03:25:25.383+00:00

    @Mongoose ,

    Try to use flow to upload zip files from pc to sharepoint.

    Go to the library you want to store zip files, click Automate>Power Automate>Create a flow based on template:Copy new files from your PC to SharePoint:

    137976-image.png 137968-image.png

    At first, To copy a file from your PC to SharePoint Online Library, You need to create a new Data gateway connection for your PC. To create a new connection, Click on “…” option and “+Add new connection” as shown in the given below screenshot:

    137960-image.png

    Once you will click on "+Add new connection", a File System action will appear where you have to enter about your PC details, please note the gateway property:Select a data gateway for PC Connection. If you don’t have any data gateway connection, then install a new on-premise data gateway from the dropdown using the “Install a gateway” option.

    137947-image.png
    Once all the field value will over, Click on “Create”, then fill in the related property as shown below:

    138004-image.png

    Copy all zip files to the folder you specified in PC(per my test is C:\Zip), then flow will run and copy them to sharepoint folder as shown below:

    137907-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1: /api/attachments/137945-image.png?platform=QnA 3: /api/attachments/137946-image.png?platform=QnA

    0 comments No comments

  2. Mongoose 1 Reputation point
    2021-10-06T13:52:44.817+00:00

    @JulieWang-MSFT
    Thank you for this information. This is a surprisingly complex process just to copy a file to SharePoint. We do not yet have a gateway server created for Power Automate so this will take a fair amount of time. Unfortunately, we are moving our office to a new building this week so I will not be able to attempt this until sometime next week. I'll let you know then if I have any issues.
    I wish there were a way to do a proof of concept test prior to implementing this. I hate to spend all this time and effort only to find the files are still being corrupted by the upload process.
    Thanks, again.


  3. Mongoose 1 Reputation point
    2021-10-27T13:16:37.817+00:00

    I am able to upload a large zip file consistently by adding it to OneDrive and then moving it to the SharePoint destination. However, the zip file still will not open in SharePoint. If I download the file from SharePoint, it will open. Using my original method of uploading the file to SharePoint, the file downloaded from SharePoint was corrupt. This is an improvement over my initial issue. The version of the file uploaded to SharePoint is no longer corrupt. Is there a reason SharePoint (or OneDrive, for that matter) will not display the contents of a large zip file (greater than approximately 2 GB) in the web interface? I do not want to be required to download the zip file just to browse the contents to see if the desired file is contained within the zip file.


  4. Mongoose 1 Reputation point
    2021-10-29T11:08:28.74+00:00

    Here is a screen shot of the message....
    145004-zippreview.jpg

    0 comments No comments