Click or drag to resize
ISharePointFileServiceDeleteFile Method
Deletes the file specified by serverRelativeUrl from the SharePoint server. Deleting a non-existent file within SharePoint site is a void action. Throws exception when serverRelativeUrl is invalid (does not point within any SharePoint site).

Namespace: CMS.SharePoint
Assembly: CMS.SharePoint (in CMS.SharePoint.dll) Version: 8.2.23
Syntax
C#
void DeleteFile(
	string serverRelativeUrl
)

Parameters

serverRelativeUrl
Type: SystemString
Server relative URL of the file.
Exceptions
ExceptionCondition
ArgumentExceptionThrown when serverRelativeUrl does not point within any SharePoint library.
ArgumentNullExceptionThrown when serverRelativeUrl is null.
SharePointServerExceptionThrown whenever server error occurs.
WebExceptionThrown when error related to network or protocol occurs.
SharePointConnectionNotSupportedExceptionThrown when given connectionData contains unsupported authentication mode or invalid URL.
ExceptionThrown in case of unexpected error condition.
See Also