SP.File.serverRelativeUrl Property
Applies to: SharePoint Foundation 2010
In this article
Property Value
Applies To
Remarks
Gets the relative URL of the file based on the URL for the server.
var value = SP.File.get_serverRelativeUrl();
Property Value
Type: String
Applies To
Exceptions
- 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 null. It must be a URL of server relative form.