Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CreateParentFoldersForFile method
Collapse the table of content
Expand the table of content

SPUtility.CreateParentFoldersForFile method

Creates a folder hierarchy necessary to create a list item, including the list in which to create the item, as well as an indication whether to create additional list items that correspond to the folders.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public static void CreateParentFoldersForFile(
	SPList list,
	string url,
	bool createAsListItem


Type: Microsoft.SharePoint.SPList

The list in which the item is to be created.

Type: System.String

The URL of the list item to be created.

Type: System.Boolean

true to create list items that correspond to the folders; otherwise, false.


list is a null reference (Nothing in Visual Basic).

Set the createAsListItem parameter to true when creating list items that correspond to the folder structure, which may be useful when creating lists that are not document library lists.

© 2015 Microsoft