> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/hardware/~/revisions/aurjDoOhAcnQLHeoR1ks/card-readers/mms-dyna-devices/emv-common-kernel/dynaflex-ii-go/documents/developers-manuals/programmers-manual-commands/commands/file-operations/delete-file-from-device.md).

# Delete File from Device

## Command 0xD831 – Delete File from Device

The host uses this command to request the deletion of a file stored on the device.&#x20;

The sequence of events is as follows:

{% stepper %}
{% step %}

### Host composes and sends request

The host composes a command request in the format below and sends it to the device.
{% endstep %}

{% step %}

### Device processes request

The device reads and erases the file and sends a response to the host in the format below.
{% endstep %}

{% step %}

### Failure handling

If the file read or the file erase fails, a response of failure will be sent to the host.
{% endstep %}
{% endstepper %}

## Table - Request Data for Command 0xD831 – Delete File from Device

<table><thead><tr><th>Tag</th><th width="73">Len</th><th>Value / Description</th><th width="75.33331298828125">Typ</th><th width="74.66668701171875">Req</th><th width="96.666748046875">Default</th></tr></thead><tbody><tr><td>Beginning of any wrappers, at minimum including <strong>Request Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>D831 = <strong>Command 0xD831 – Delete File from Device</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>81</td><td>04</td><td>File ID from Table 206</td><td>B</td><td>R</td><td></td></tr><tr><td>End of any wrappers, at minimum including <strong>Request Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

## Table - Response Data for Command 0xD831 – Delete File from Device

<table><thead><tr><th>Tag</th><th width="74.6666259765625">Len</th><th width="172.33331298828125">Value / Description</th><th width="77">Typ</th><th width="74.6666259765625">Req</th><th width="98">Default</th></tr></thead><tbody><tr><td>Beginning of any wrappers, at minimum including <strong>Response Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>D831 = <strong>Command 0xD831 – Delete File from Device</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>No parameters.</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>End of any wrappers, at minimum including <strong>Response Message</strong></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

## Table - Request Example

{% code title="Example (hex)" %}

```
AA 00 81 04 01 05 D8 31 84 08 D8 31 81 04 02 00 00 00
```

{% endcode %}

## Table - Response Example

{% code title="Example (hex)" %}

```
AA 00 81 04 82 05 D8 31 82 04 00 00 00 00
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.magtek.com/hardware/~/revisions/aurjDoOhAcnQLHeoR1ks/card-readers/mms-dyna-devices/emv-common-kernel/dynaflex-ii-go/documents/developers-manuals/programmers-manual-commands/commands/file-operations/delete-file-from-device.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
