Update form stops on uploading file

I have a master/detail where detail is an update form which should also handle an upload. The form will update when I put file upload server action after server action database update. I get several errors like

Please check the exact error returned as explained here: Debugging Problems
The javascript errors won’t help, you should see the exact response from the server (please check the link) for this error 500.

Actually i see the error on your page, i missed your link :slight_smile:

code: 0
file: "/usr/home/testworks.nl/htdocs/dmxConnectLib/lib/db/Connection.php"
line: 79
message: "Array to string conversion"

There is some value somewhere wrong in your server action. What is selected for the update record as a file value? How is your upload step set up?

The first error is with bootstrap. In one of the dropdown menus you use the href="http://example.com, change this to # and the error should go away.

Setting a value of a file input is not possible due to security reasons in your browser.

The last error is located in your update action, one of the values (probably the file upload) you try to store in the database is of the incorrect type. Probably an incorrect expression used.

Update server action: verslagupdate
Globals > Post > jaar = tekst, titel = tekst, bestand = file
Steps:
Step: database connection = ofswf
Step File upload: name = upload1, upload fields = {{$_POST.bestand}}, path=/uploadbestand. Create path = checked
Step Database update: name= update1, update options: jaar and titel are texttype with associated $_POST, bestand = tekst, value {{$_POST.bestand}}, condition {{_POST.bestand.name}}

Please post screenshots of:

  1. Post variables
  2. Upload file step
  3. Update record step

20190125_postvars

20190125_uploadfilestep

@web-works that is now what you should be using as a value in the update record step.
Check this video which explains what to select in order to store the file name into the database: https://docs.wappler.io/t/inserting-uploaded-file-names-in-a-database/4234 (the value is the same for insert and update record)

1 Like

Thanks Teodor. Will try to remember that. Can you explain why I get the form fields checked green?
I have some another page that is supposed to show notification on success, but instead it also show these green checks.

The green checks appear on forms that has validation applied and you submit it.

    <div class="col-sm-10">
        <textarea id="inp_titel" name="titel" dmx-bind:value="contactfill.data.contactfillq[0].titel" class="form-control"></textarea>
      </div>"

I did not add validation, or I must have missed something

Well most probably some of the fields in the form is validated. Then it marks the fields that are ok with a green color and the check icon.