DeviceStorage.delete()

This API is available on Firefox OS for privileged or certified applications only.

Summary

The delete method is used to remove a file from a given storage area.

Syntax

JavaScript
var instanceOfDOMRequest = instanceOfDeviceStorage.delete(fileName);

Parameters

fileName
A string representing the full name (path + file name) of the file to remove.

Returns

It returns a DOMRequest object to handle the success or error of the operation.

Example

JavaScript
var sdcard = navigator.getDeviceStorage("sdcard");

var request = sdcard.delete("myFile.txt");

request.onsuccess = function () {
  console.log('File successfully removed.');
}

request.onerror = function () {
  console.warn('Unable to remove the file: ' + this.error);
}

Specification

Not part of any specification.

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/devicestorage/delete

API B2G Device Storage Firefox OS Method Reference Référence WebAPI