<p>That's a bug. The Asset wasn't saved because it would not be validated due to conflicting filenames. Thankfully, it's <a href="https://github.com/craftcms/cms/commit/8ca98621a49f2650ee0f15ae9dc6a6fb1c9df145" rel="nofollow noreferrer">fixed now</a>.</p>

CC BY-SA 3.0
2018-02-09T07:33:51.777Z
2018-02-09T07:33:51.777Z
Andris Sevcenko
<p>I have a front end save entry form which users can attach photos too, it all works fine unless a photo with the same filename is saved, in this instance the entry saves but the asset field is just left blank, can't find anything in the docs,</p>

<p>Any help or a point in the right direction appreciated!</p>

<pre><code>&lt;form id="addCompanyForm" method="post" enctype="multipart/form-data" accept-charset="UTF-8"&gt;
  {{ csrfInput() }}
  &lt;input type="hidden" name="sectionId" value="7"&gt;
  &lt;input type="hidden" name="enabled" value="0"&gt;
  &lt;input type="hidden" name="action" value="entries/save-entry"&gt;

  &lt;input id="title" type="text" name="title"&gt;
  &lt;input id="companyLogo" type="file" name="fields[companyLogo]" accept=".png, .jpg"&gt;

  &lt;/form&gt;
</code></pre>

CC BY-SA 3.0
2018-02-08T19:00:35.703Z
Do you use a custom controller for it or the default craft way?
Robin Schambach
CC BY-SA 3.0
2018-02-08T19:52:23.473Z
@RobinSchambach default craft way, have updated original Q with the form code
craigh44
<assets><craft3><frontend-form>
Craft 3 front end form file uploads not saving if filename exists?
# Craft 3 front end form file uploads not saving if filename exists?

(Asked by: username_0 on 2018-02-08)

I have a front end save entry form which users can attach photos too, it all works fine unless a photo with the same filename is saved, in this instance the entry saves but the asset field is just left blank, can't find anything in the docs,
Any help or a point in the right direction appreciated!

  {{ csrfInput() }}

**Tags:** assets, craft3, frontend-form

> **Comments:**
> **username_1**: Do you use a custom controller for it or the default craft way?  
> **username_0**: @RobinSchambach default craft way, have updated original Q with the form code  

---

## 1 answers

### Answer by username_2 on 2018-02-09. Score: 1 | Accepted answer

That's a bug. The Asset wasn't saved because it would not be validated due to conflicting filenames. Thankfully, it's [fixed now](https://github.com/craftcms/cms/commit/8ca98621a49f2650ee0f15ae9dc6a6fb1c9df145).


---

