Documentation
Storage
getChanges
Each element in the storage.getChanges
list has a status: existing and currently used in Redactor files and images are true
, and those deleted by the user are false'
Now you know which files can be safely deleted from server (hint: those with false
status) and you can delete these files using their ids.
Here's an example of storage.getChanges
method in use:
var changes = $R('#content', 'storage.getChanges');
for (var key in changes)
{
if (changes[key].status === false) // element was deleted
else // element is still in the content
}
Here's an example of an object that is returned by getChanges:
"some-id: {
id: "some-id", // an id of a file. This id had been set during upload.
node: img, // or 'a' DOM node of element
status: true, // or false if element is deleted
type: "image" // or file
}
dkjgvo65776inru43654