Tag Info

Hot answers tagged


You might not have permissiosns to see that file. You should also add a check for file existence like : SPFile u = l.RootFolder.Files.Add(l.RootFolder.Url + "/" + f.Name, f.OpenBinary(), true); if (l.Exists) { l.RootFolder.Update(); l.Update(); w.Update(); }


Verify that your $file.Name is truly "myfile.docx". Try these amended lines (with the other lines as is): $DestUrl ="MyDocuments/SubFolderName/" $file.MoveTo($DestUrl + $file.Name, true)

Only top voted, non community-wiki answers of a minimum length are eligible