<p>File fields are used for uploading new images. To delete all the Assets for a field, submit a hidden field with no values.</p>

<pre><code>&lt;input type="hidden" name="fields[assetsField]" value="" /&gt;
</code></pre>

<p>If, on the other hand, you want to retain some of them, then make that hidden field an array with the values you'd like to keep. Like this</p>

<pre><code>&lt;input type="hidden" name="fields[assetsField][]" value="someAssetId" /&gt;
&lt;input type="hidden" name="fields[assetsField][]" value="someOtherAssetId" /&gt;
</code></pre>

<p><code>someAssetId</code> and <code>someOtherAssetId</code> being the Asset IDs you'd like to keep for that field.</p>

CC BY-SA 4.0
2019-11-07T16:03:39.883Z
Thank you SO much :)
iamkeir
CC BY-SA 3.0
2017-01-12T07:47:20.717Z
2017-01-12T07:47:20.717Z
Andris Sevcenko
<p>I see for users, I can add a hidden field <code>&lt;input type="hidden" name="deleteUserPhoto" value="1" /&gt;</code> to remove the uploaded photo, however I need to allow this functionality for an assets field in an entry form.</p>

<p>I have tried submitting an empty file field, but it just retains the existing uploaded asset after submission. </p>

<p>Is there a trigger similar to <code>deleteUserPhoto</code> that I can use here?</p>

<assets><entry><entry-form>
How do I allow a user to remove an uploaded asset from a front-end entry form?
# How do I allow a user to remove an uploaded asset from a front-end entry form?

(Asked by: username_0 on 2017-01-12)

I see for users, I can add a hidden field  to remove the uploaded photo, however I need to allow this functionality for an assets field in an entry form.

I have tried submitting an empty file field, but it just retains the existing uploaded asset after submission.

Is there a trigger similar to `deleteUserPhoto` that I can use here?

**Tags:** assets, entry, entry-form

---

## 1 answers

### Answer by username_1 on 2017-01-12. Score: 8 | Accepted answer

File fields are used for uploading new images. To delete all the Assets for a field, submit a hidden field with no values.


If, on the other hand, you want to retain some of them, then make that hidden field an array with the values you'd like to keep. Like this



someAssetId and someOtherAssetId being the Asset IDs you'd like to keep for that field.

> **Comments:**
> **username_2**: Thank you SO much :)  

---

