Share via


File.ServerRelativeUrl property

Gets the relative URL of the file based on the URL for the server.

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

Syntax

'Declaration
Public ReadOnly Property ServerRelativeUrl As String
    Get
'Usage
Dim instance As File
Dim value As String

value = instance.ServerRelativeUrl
public string ServerRelativeUrl { get; }

Property value

Type: System.String
A string that contains the URL.

Exceptions

Exception Condition
[System.UnauthorizedAccessException]

The current user has insufficient permissions. Error code: -2147024891.

Remarks

The ServerRelativeUrl property returns a string in the following form, which excludes the name of the server or root folder: /Site_Name/Subsite_Name/Folder_Name/File_Name.

It must not be a null reference (Nothing in Visual Basic). It must be a URL of server relative form.

See also

Reference

File class

File members

Microsoft.SharePoint.Client namespace