Nov 20, 2020, 5:55 PM
Help for using fileUploadField inside a form
Hi,
I have problems to submit a form using standardsubmit config with a fileUploadField inside.
How can I achieve this? There is no isUpload attribute for fileUploadField, nor for the form.
Is it possible to have an example?
What happens: when submitting, form fields aren't sent to server, but if I remove the fileUploadField, the request is sent correctly (in the browser I can see the field data).
My field:
Regards,
Fla
I have problems to submit a form using standardsubmit config with a fileUploadField inside.
How can I achieve this? There is no isUpload attribute for fileUploadField, nor for the form.
Is it possible to have an example?
What happens: when submitting, form fields aren't sent to server, but if I remove the fileUploadField, the request is sent correctly (in the browser I can see the field data).
My field:
<ext-fileUploadField id="txtFileUpload" emptyText="Upload file" fieldLabel="Load nodes"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
allowBlank="false" allowOnlyWhitespace="false" name="fileUpload" submitValue="true">
</ext-fileUploadField>
the form button is: <buttons>
<ext-button text="Save " iconAlign="left" iconCls="x-fa fa-save" width="260" formBind="true">
<listeners>
<click handler="if(App.myForm.isValid()) submit(App.myForm);" />
</listeners>
</ext-button>
</buttons>
where submit function is the following one: var submit = function (form) {
form.getForm().setEnctype('multipart/form-data');
form.getForm().submit({
waitMsg: 'Verifying...',
method: 'POST',
url: '@Url.Action("Save", "CreateTask")'
});
}
Regards,
Fla