How i can read formData from uploader in form data "Form"

Hello,
I have simple Form

Id Form : form1
Field: Name
Field: Address
Field: File attach

  • Uploader File 1 (This have formData:{‘id_file’:1})
  • Uploader File 2 (This have formData:{‘id_file’:2})

If i clicked button, it will trigger action saving form
and i have expectation “data” form like this to send via AJAX

data:{
‘name’:valueName,
‘address’:valueAddress,
‘attach_file’:[
{‘id_file1’:1,upload:objectFileUploader1 (obj.file) },
{‘id_file1’:2,upload:objectFileUploader2 (obj.file) },
]
}

it is possible to process data like that? i want to read my file upload based on “id_file”, but i can’t read key id_file on my server side (python)

https://snippet.webix.com/f9y9l7vv

Thank You

Hi @vickypaulantono ,
Initially form values and all files are separately. Moreover, for sending one file a separate request is used.

  1. I would suggest to use one uploader in order not to create unnecessary components and several Data Stores. This will disable custom visualisation of uploader though. Please, check the snippet: Code Snippet

  2. In case custom visualisation is essential and you need to send all the files by a single request, you will need to create a FormData object, append all the files/form values and send the request with plain Javascript:
    Code Snippet