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

SPUtility.GetUrlFileName method

Returns the filename part of the URL.

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

public static string GetUrlFileName(
	string url


Type: System.String

The URL path.

Return value

Type: System.String
A string that contains the filename part of the URL.

If the url parameter is http://server/web/list/folder/file.txt, the returned filename part is "file.txt".

© 2015 Microsoft