While FormComponent works reasonably well, It completely lacks file upload support. The problem is separated in a few parts:
HTML seems to need a form tag with an enctype="multipart/form-data" attribute to allow file uploads
There must be a POST request. Subsequent GET requests loose the file again - it must be kept track of in between (it's deleted/GCed if the user does not finish the form)
I think the relevant code parts are in tetra/js/tetra.core.js - this is the main part where all the Js magic of Tetra happens - note: if you change something there locally, call tetra/build_js.sh to update the static min files and debug maps automatically.
I think the callServerMethod() and getStateWithChildren(...) methods closely resemble the code @waqasidrees07 wrote to upload the file in his PR #70. But it has to be done in tetra.core.js.
In the test_tetra_forms repository, there should ideally only be changed some minimal things like an added <form enctype="multipart/form-data"></form> tag.
While
FormComponent
works reasonably well, It completely lacks file upload support. The problem is separated in a few parts:enctype="multipart/form-data"
attribute to allow file uploads<form enctype="multipart/form-data"></form>
tag.