Skip to content

Deleting a File

To delete a file from the Backendless file storage, it must be identified by the file path/name. Files in the Backendless storage have the following URL structure:

https://api.backendless.com/<application id>/<REST API key>/files/<path>/<file name>

The API to delete a file uses the <path>/<filename> part to identify the file which must be deleted.

Backendless.Files.remove( filePath )
 .then( function() {
 })
 .catch( function( error ) {
 });

where:

Argument                Description
filePath Path of the file to delete. The path must consist of the file path and file name.

Return Value

None.

Example

Backendless.Files.remove( "my-folder/myfile.txt" )
 .then( function() {
   console.log( "file has been deleted" );
 })
 .catch( function( error ) {
   console.log( "error - " + error.message );
 });