question

Mongoose-1404 avatar image
0 Votes"
Mongoose-1404 asked Mongoose-6653 answered

How to consistently upload ZIP files to SharePoint

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.

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoyZ avatar image
0 Votes"
JoyZ answered JoyZ edited

@Mongoose-1404,

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.





image.png (6.8 KiB)
image.png (21.9 KiB)
image.png (22.6 KiB)
image.png (41.6 KiB)
image.png (19.4 KiB)
image.png (6.8 KiB)
image.png (36.8 KiB)
image.png (21.9 KiB)
image.png (26.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Mongoose-6653 avatar image
0 Votes"
Mongoose-6653 answered JoyZ commented

@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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You may also want to look at alternative tools that use chunked file uploads (see https://techcommunity.microsoft.com/t5/microsoft-sharepoint-blog/always-use-file-chunking-to-upload-files-gt-250-mb-to-sharepoint/ba-p/509988).

There are tools that offer this capability, cater for network glitches and also check the original file size and SharePoint size after uploading.

Paul | SLIM Applications

0 Votes 0 ·

@Mongoose-1404,

Currently there is no such way to do a proof of concept test prior to implementing this.

You could test it with a small amount of pdf documents to check if it works well.

Please remember to update this thread if you need further assistance.

0 Votes 0 ·
Mongoose-6653 avatar image
0 Votes"
Mongoose-6653 answered Mongoose-6653 commented

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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Mongoose-1404,

Thank you for your update.

Is there any error message when you open the zip file grater than 2 GB online?

0 Votes 0 ·

There is a message that says something to the affect of Hmmm....We seem to be having a problem opening your file...." I'll get a screen shot tomorrow to post. As best as I can tell, the preview function simply doesn't work for zip files > 2 GB. I have been unable to find any documentation on this limitation, but it seems to exist.

0 Votes 0 ·
Mongoose-6653 avatar image
0 Votes"
Mongoose-6653 answered

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



zippreview.jpg (12.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.