1

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!

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

  <input id="title" type="text" name="title">
  <input id="companyLogo" type="file" name="fields[companyLogo]" accept=".png, .jpg">

  </form>
2
  • Do you use a custom controller for it or the default craft way? Commented Feb 8, 2018 at 19:00
  • @RobinSchambach default craft way, have updated original Q with the form code
    – craigh44
    Commented Feb 8, 2018 at 19:52

1 Answer 1

1

That's a bug. The Asset wasn't saved because it would not be validated due to conflicting filenames. Thankfully, it's fixed now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.