SP.Web.mapToIcon Method (sp.js)

Returns the name of the image file for the icon that is used to represent the specified file.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

SP.Web.mapToIcon()

Parameters

  • fileName
    A string that specifies the name of the file that is used to determine the image file name.

  • progId
    Specifies the ProgID of the application that was used to create the file.

  • size
    Type: Utilities.IconSize

    Specifies the icon size.

Return value

Type: SP.StringResult

The name of the image file.

Remarks

If a null or empty string is passed into the fileName parameter, the protocol server must return an empty string.

If the value of the progId parameter is null or an empty string, the protocol server must return the name of the image file based on the specified fileName. The server selects the image file based on the fileName in an implementation-specific manner.

REST resource endpoint

See Web resource for more information.

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/mapToIcon(fileName,progId,size)

HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

POST http://<sitecollection>/<site>/_api/web/mapToIcon(fileName,progId,size)

Resource parameters

  • fileName

  • progId

  • size