Share via


SP.FileCollection.addTemplateFile Method (sp.js)

Adds a ghosted file to an existing list or document library.

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

SP.FileCollection.addTemplateFile()

Return value

Type: SP.File

REST resource endpoint

See FileCollection resource for more information.

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/addTemplateFile(urlOfFile,templateFileType)

HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

POST http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/addTemplateFile(urlOfFile,templateFileType)

Resource parameters

  • urlOfFile

  • templateFileType

Parameters

  • urlOfFile

  • templateFileType