App Connect Form Validator Support Product Page

why this message "Please select a file with a valid file type" is shown?

Asked 25 Mar 2018 18:12:30
1
has this question
25 Mar 2018 18:12:30 andrea mac posted:
Hi, I've a problem vith an update form.
This form has a file field to select an image. On this field there are two validation rules, an accept rule and a max file size rule. It's not required.
When I send the form, however, a message appears under the file field, "Please select a file with a valid file type", if I don't select a file.
I've found this message in the upload.php file in dmxConnectLib/lib/Validator/Messages/en.
Can anyone help me? How can I leave the file field without any file selected?
Thank you

Replies

Replied 26 Mar 2018 14:08:21
26 Mar 2018 14:08:21 Teodor Kuduschiev replied:
Hi Andre,
Just test this locally and i have no issue submitting the form without a file selected.
Can you tell me where is the validation applied - is it on the server-side, or on the client-side? What are you doing in your action file after upload?
Replied 26 Mar 2018 16:23:05
26 Mar 2018 16:23:05 andrea mac replied:
Hi Teo,
validation is applied on the client-side (by app-connect).
In the action file, after the upload, there's the update query.
Unfortunately I can't attach any file to this post but I've done some screenshots of the app connect structure, of the action file and of the update query too.
So if you need them let me know.
I want to say that if you select an image file in my update form, everything runs very well.
Furthermore the update form is very similar to the insert form and this one runs well even if you don't select any file.
Thank you for your attention
regards
Replied 27 Mar 2018 16:22:23
27 Mar 2018 16:22:23 andrea mac replied:
Hi,
I should have found a public function accept in dmxConnectLib\lib\validator\rules\upload.php.
I hope it's useful to solve the problem.

Reply to this topic