Lucaz
September 24, 2021, 10:05am
1
Hi,
a curl command or Postman and any other client where I can specify the name of the form works fine but Webix.
The backend checks for the MIME data for the form field name as in the curl command
curl... --form 'file=@"/Users/luca2/Github/webix1/curl/IRISinEKS2.pdf
I am missing the way to specify that name. In this case it’s that file string.
I tried with
formData:{ name:"file"}
// and
formData:{ file="something"}
but it does not work.
We have also tried to change the backend MIME Data check that we have, to
filename and even to
upload (yes the value; getting desperate here)
because when debugging, I see that you send:
Content-Disposition: form-data; name="upload"; filename="myFile.pdf"
Content-Type: application/pdf
Any suggestion greatly appreciated…
Thanks
Lucaz
September 24, 2021, 10:19am
2
FYI whatever I define in formData it is never passed in the request you send.
it is always exactly the same as I reported above or:
Content-Disposition: form-data; name="upload"; filename="myFile.pdf"
Content-Type: application/pdf
I don’t know how other people can make this work when the backend checks for MIME…
Thanks for any support
Lucaz
September 24, 2021, 1:41pm
3
For posterity,
the solution I implemented for the time being is to use the “upload” string that is supplied by default in the Content-Disposition definition.
That is the HTML field in the form that webix appears to create by default.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
By using the “upload” as the field name in the backend where there is the MIME check I got it to work.
IMO it is a shame that other field and values are never passed from the formData definition.
HTH