Upload Widget Validation

  

Hi, 

i have problem in validation upload widget.

can i validate the upload widget

this is the example from my upload form. I want to make the extensions files just .xlsx can it happen ?


Thank you.

Hello Dicky, welcome to the forum.

You can check the extension in the filename property of the Upload widget when you submit to the server. Other than that you would have to resort to JavaScript, I think...

You can also check Forge for other upload components that may offer the possibility to define the accepted extensions of the files to upload.

Cheers.

Eduardo Jauch wrote:

Hello Dicky, welcome to the forum.

You can check the extension in the filename property of the Upload widget when you submit to the server. Other than that you would have to resort to JavaScript, I think...

You can also check Forge for other upload components that may offer the possibility to define the accepted extensions of the files to upload.

Cheers.

Hi Eduardo,

Do you mean, i just can validate after uploaded the file ?

Do you have any example for this ?

Thank you.


Solution

Dicky Wang wrote:

Hi Eduardo,

Do you mean, i just can validate after uploaded the file ?

Do you have any example for this ?

Thank you.


Yes. At least, with the system Upload I think only in the server side.
Don't have any example, but when you reach server (button has to be submit to the file to be sent), you can check the Upload in the server, as the properties like the File Content and the File name are available, and you than can check if the file name finishes with ".xlsx" and proceed accordingly.

Cheers.

Solution

Eduardo Jauch wrote:

Dicky Wang wrote:

Hi Eduardo,

Do you mean, i just can validate after uploaded the file ?

Do you have any example for this ?

Thank you.


Yes. At least, with the system Upload I think only in the server side.
Don't have any example, but when you reach server (button has to be submit to the file to be sent), you can check the Upload in the server, as the properties like the File Content and the File name are available, and you than can check if the file name finishes with ".xlsx" and proceed accordingly.

Cheers.

ok, thank you i got it.


Hello Dicky, 

Hopefully you already solved your issue after Eduardo's help but just in case here is a simple FAQ on How to validate file input on a File Upload Widget.

Cheers

Nice finding, João! :)