Add-PNPFile fails on uploading files larger than 250 MB
###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:###
- 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

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
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."
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.
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_"
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)
I am also running into the same issue... would love this to be resolved!
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 What tool to you use for scanning and re-uploading large files?
The free tool is "Fiechter.OneDriveBackup".
Is there any workaround for it?
Has there been any changes to allow for larger files?
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.