This API is available on Firefox OS for privileged or certified applications 仅。
delete
method is used to remove a file from a given storage area.
var instanceOfDOMRequest = instanceOfDeviceStorage.delete(fileName);
fileName
A string representing the full name (path + file name) of the file to remove.
It returns a
DOMRequest
object to handle the success or error of the operation.
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);
}
Not part of any specification.