Forum Discussion
YoussefC1135
Jun 29, 2019Copper Contributor
Add files to sharepoint sublist
I upload documents from the local drive to sharepoint site.
My issue is : How to upload to sublist sharepoint
$SiteURL = "domain/sites/testing/"
$libraryName="Documents/X"
$SPOnlineUserName="user@domain"
The script work when i upload to Documents
But in X folder , i get this error :
List 'Documents/X' does not exist at site with URL 'domain/sites/testing'
Any Idea Please ?
Youssef
YoussefC1135 I think my blog might help with this
Specifically you need to reference the folder in the document library
$spFile = $spList.RootFolder.SubFolders[$Target].SubFolders[“Imported Files”].Files.Add($doc.Filename,$Uploadedfile)
Hopefully this helps