# Delete

There are two ways to delete files using Larupload:

* Delete by `detach` function
* Delete by assigning `false` to the file property
* Delete by assigning `LARUPLOAD_NULL` to the file property <mark style="color:red;">\[deprecated]</mark>

{% tabs %}
{% tab title="Detach" %}

```php
$upload->file->detach();
# or (recommended)
$upload->attachment('file')->detach();

$upload->save();
```

{% endtab %}

{% tab title="False" %}

```
$upload->file = LARUPLOAD_NULL;
$upload->save();
```

This feature was <mark style="color:red;">introduced</mark> in version <mark style="color:red;">3.0.0</mark>.
{% endtab %}

{% tab title="LARUPLOAD\_NULL" %}

```
$upload->file = LARUPLOAD_NULL;
$upload->save();
```

This feature has been <mark style="color:red;">deprecated</mark> since version <mark style="color:red;">3.0.0</mark>. We recommend using the `detach` method or assigning `false` instead.
{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://mostafaznv.gitbook.io/larupload/delete.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
