SP.File.deleteObject Method (sp.js)

Deletes the File object.

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

SP.File.deleteObject()

Return value

Undefined

Remarks

If the file does not exist, the Delete method silently fails and does not throw a FileNotFoundException.

REST resource endpoint

See File resource for more information.

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)/deleteObject()

HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

POST http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)/deleteObject()