3

How to create a subfolder using Client Object Model.
I know how to create a folder under a document library but i dont know how to create a folder under a folder or a listItem.

Gaby
  • 2,923
  • 4
  • 38
  • 52

2 Answers2

4

You need to set the FolderUrl property of the ListItemCreationInformation to the parent folder.

Rob Windsor
  • 6,744
  • 1
  • 21
  • 26
  • 1
    I also want to know how to. I added the FolderUrl property, but I got this error: Invalid file name. The file name you specified could not be used. It may be the name of an existing file or directory, or you may not have permission to access the file. – nixjojo Jul 13 '12 at 04:06
1

FolderUrl property of the ListItemCreationInformation must be set folder.ServerRelativeUrl. Many other advises on this situation omit mentioning this essential requirement. I was confused, which URL to pass and lost a lot of time fighting with errors when passing absolute URL or other variants.

Boris Zinchenko
  • 2,142
  • 1
  • 24
  • 34