1. Tasks
  2. Delete File

Tasks

Delete File

The Delete File task deletes a file from the Stubber file system.

For cases of extreme sensitivity, the delete_file task can be used to remove a file completely from the Stubber file system.

Basic usage

loading...

Parameters

fileuuid
optional
string

The UUID of the file to be deleted.


fileuuids
optional
array

An array of UUIDs of the files to be deleted.


filename
optional
string

The name of the file to be deleted. This only works for files on the same stub where the task is executed.


filenames
optional
array

An array of filenames to be deleted. This only works for files on the same stub where the task is executed.


files
optional
array

An array of files to be deleted. A file is an object that contains at least a fileuuid. Common examples of this are, eg. the attachments of a stub or stubpost and can be referenced as:

  • ~~stub.attachments
  • ~~stubpost.attachments

This will delete all attachments of the stub or stubpost.


Result

loading...

Properties

fileuuid

integer

The UUID of the file that was deleted.


Examples

Request with interpolated fileuuid

loading...

Delete two specific files and all attachments of this stub

editor
        {
    "tasktype": "delete_file",
    "params": {
        "fileuuids": ["~~stub.data.private_file_fileuuid", "~~stub.data.public_file_fileuuid"]
        "files": "~~stub.attachments"
    }
}


      

Request with filename

loading...