PnP-PowerShell icon indicating copy to clipboard operation
PnP-PowerShell copied to clipboard

Add-PNPFile fails on uploading files larger than 250 MB

Open ShanesCows opened this issue 9 years ago • 11 comments

###Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:###

  1. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.

The issue may be underlying libraries but I am not a developer so I am not helpful in determining that.

Reporting an Issue or Missing Feature

When I try to add-pnpfile for a file larger than 250 MB I get the following error:

Add-PnPFile : The request message is too big. The server does not allow messages larger than 262144000 bytes.

Expected behavior

SPO supports much larger file sizes so I would like to be able to upload to the SPO max file size.

Actual behavior

image

Steps to reproduce behavior

Add-PnPFile -Path .\camtasia.txt -Folder fileshare

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint 2013
  • [ ] PnP PowerShell for SharePoint 2016
  • [X ] PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

2.16.1706.1

How did you install the PnP-PowerShell Cmdlets?

  • [ ] MSI Installed downloaded from GitHub
  • [X ] Installed through the PowerShell Gallery with Install-Module
  • [ ] Other means

ShanesCows avatar Jul 18 '17 16:07 ShanesCows

I do try with a file ~ 300MB, though it does not throw exact error message like you have, I am not able to upload it too ... Simply "Add-PnPFile : The remote server returned an error: (404) Not Found."

victory-tb avatar Jul 21 '17 11:07 victory-tb

I think that has always been like this with PnP PowerShell. I have some scripts that allowed me to upload files up to 2GB, but I don't remember exactly what made the difference beside changing the http session timeout.

mrik23 avatar Jul 22 '17 11:07 mrik23

For files a bit over 250MB, error: "_Add-PnPFile : The request message is too big. The server does not allow messages larger than 262144000 bytes. At line:27 char:1

  • Add-PnPFile -Path $FullName -Folder $fn -Values @{Modified=$Mod. ...
  •   + CategoryInfo          : WriteError: (:) [Add-PnPFile], ServerException
      + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Files.AddFile_"
    
    

For files as large as 600MB-1GB, error: "_Add-PnPFile : The underlying connection was closed: An unexpected error occurred on a send. At line:27 char:1

  • Add-PnPFile -Path $FullName -Folder $fn -Values @{Modified=$Mod. ...
  •   + CategoryInfo          : WriteError: (:) [Add-PnPFile], WebException
      + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Files.AddFile_"
    
    

Or: "_Add-PnPFile : The remote server returned an error: (404) Not Found. At line:27 char:1

  • Add-PnPFile -Path $FullName -Folder $fn -Values @{Modified=$Mod. ...
  •   + CategoryInfo          : WriteError: (:) [Add-PnPFile], WebException
      + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Files.AddFile_"
    

victory-tb avatar Jul 28 '17 04:07 victory-tb

Did this ever go anywhere or anyone ever find a workaround using PnP? I've just run into this same issue (have a file that is ~260MB that I need to upload and getting the same error)

Brentless avatar Jan 17 '18 21:01 Brentless

I am also running into the same issue... would love this to be resolved!

pauliev avatar Feb 20 '18 23:02 pauliev

At that time I end up uploading all files except large files and using another tool to scan & re-upload missing files [large files].

victory-tb avatar Feb 22 '18 03:02 victory-tb

@victory-tb What tool to you use for scanning and re-uploading large files?

pauliev avatar Feb 23 '18 00:02 pauliev

The free tool is "Fiechter.OneDriveBackup".

victory-tb avatar Mar 28 '18 14:03 victory-tb

Is there any workaround for it?

jmd3-sivailango avatar Mar 30 '20 17:03 jmd3-sivailango

Has there been any changes to allow for larger files?

rusticles avatar May 20 '20 00:05 rusticles

Still not working. This was supposed to be a fix for the 250MB list item attachment limit. I am copying the files to a doc library instead and this doesn't work either. Makes no sense.

Lucho1970 avatar Jul 28 '20 20:07 Lucho1970