My client has a form wizard for on-boarding potential new customers that requires 4 separate file upload input fields be used to gather the necessary paperwork to initiate their customer's account. (Files are generally PDFs or scanned images)

In short, I want to create a separate, custom upload directory location for each customer and then upload their set of documents into that folder location on Siteglide.

Issue #1 - Custom Upload Directory Is Being Ignored/Overridden

I am making use of the optional parameter “upload_dir” to set a starting location for saving the uploads to “documents/customer-uploads/“, as shown below:

{%- include 'form', id: '3', layout: 'new-customer', upload_dir: 'documents/customer-uploads/'-%}

Inspecting the page with Dev Tools shows that this part of the process appears to work as expected, resulting in the following hidden input field appearing on the page:

<input id="upload_dir" value="documents/customer-uploads/" type="hidden">

I then use JavaScript to append a sub-directory to that initial folder location using the email address that the customer enters. This also appears to update as expected:

<input id="upload_dir" value="documents/customer-uploads/username@domain.com/“ type="hidden">

According to the documentation, one would expect that this should cause the four uploaded files to be placed into the specified “custom” upload location.  Unfortunately, the system ignores/overrides the custom upload location for some reason and instead forces files into the directory: “documents/form_uploads/form_X/“

 

Issue #2 - Form Arbitrarily Selects One File to Populate All 4 Upload Fields, Then Uploads That File and Ignores Other Files

Oddly, the form selects one file (in the third upload field??), and then uses that to populate all the other upload fields and uploads just that one file into the (incorrect) upload directory (as discussed above). The resulting case then shows the same file and location in each of the four fields. The other files are ignored. 

It also seems to rename each file appending a form ID? to the files. Is that necessary?

 

Summary

 I am trying to put all 4 files that get uploaded by the user, into a unique sub-directory based on their email address inside a folder called "customer-uploads."

My problem is I can’t force the system to use of my custom upload directory nor will it upload ALL of the files, irrespective of the directory the system chooses to use.

My best shot at summarizing this visually
My best shot at summarizing this visually