I have no idea what happened but from staging I deleted dropzone module and all project/{code,template} files then reuploaded to staging, recreated the database and flushed the cache and it seems it's creating the input field now but fills with an error after the value attr.

  1. value="ERROR [Notice]: Array to string conversion
  2. IN POST /hub/rates/ChallengeForm/field/Files/upload
  3. Line 965 in /var/www/html/my-site/public_html/framework/view/Requirements.php
  5. Source
  6. ======
  7. 956: }
  8. 957: }
  9. 958:
  10. 959: $response->addHeader('X-Include-JS'"

I mean after files are added. You see them on the front-end but no input fields are created.

It's working correctly on my local running PHP7.0 but not staging running PHP7.1

but, if the user hasn’t added any files, wouldn’t $AttachedFiles be empty?

Looks like attached files section isn't generating <input class="" type="hidden" name ="$Up.InputName" value="">

  1. <div class="attached-file-inputs" data-input-name="$InputName">
  2. <% if $AttachedFiles %>
  3. <% loop $AttachedFiles %>
  4. <input class="input-attached-file" type="hidden" name="$Up.InputName" value="$ID">
  5. <% end_loop %>
  6. <% end_if %>
  7. </div>
🤔 (1)

I'm just a bit lost as to how to figure out exactly why this isn't working.

Are you trying to save the actual binary file into the database?

also, does your form have the enctype="multipart/form-data" ?

Not trying to save actual binary file into db.

I'm using the dropzone module as it's downloaded from the repo. Form is generated via new Form(Controller::curr(), __FUNCTION__, $fields, $actions, $validator).

The Form elem looks something like the following which includes the attribute <form id="Form_PageForm" action="/page/Form" method="post" enctype="multipart/form-data" class="form">

and if you echo or print_r() $data you can see the rest of the form fields but no files?

I haven’t used dropzone, but it shouldn’t be too hard to debug 😬

I'm going to add a new comment just below this thread with a bit more information with what is happening

👍 (1)

I'm just lost as to why this could be happening. I've recently upgraded from SS v3.6 to v3.7.1 and am using PHP7.1.

Hey, I'm using dropzone for users to upload an image then save that into the database when the form submits. For some reason the file isn't being saved into the database. I've checked the Files table to be sure it's not there. The rest of the form data is saved to the database. After checking whether there is any information from the form submission from the File field, it looks like nothing has been submitted $data = $form->getData(); echo $data['Files']; //nothing is here. I thought perhaps it was permissions with the file being saved to disk so ensured no folders needed to be created during upload and the file was uploaded to disk but not saved in the database. There isn't any errors that I can see pertaining to this.

Neat thanks @firesphere I'll have a look into both of those options