Unable to validate uploaded Excel file extension in interface

Hi everyone,

I’m working on an interface where the user needs to upload an Excel file with the .xlsx extension. My goal is to validate the file extension directly in the interface, before enabling the "ACCEPT" button.

In my current setup, I’m using the disabled parameter of the a!buttonWidget() to check two things:

  1. That the variable local!excel is not null or empty.

  2. That the uploaded file name (converted to string) contains the .xlsx extension, which I have defined in a constant (cons!CEDT_CONS_EXTENSIONES_DOCUMENTOS).

When I use touniformstring(local!excel), it only returns the file ID (a numeric value), not the original file name. Because of that, I can’t compare it with the extension constant to validate the file type.

Here I’m attaching a demonstration of the interface when I upload a file that is not an Excel type. 

Is there any way to retrieve the original file name (or its extension) from the uploaded file in the interface, so I can perform this validation before enabling the button?
Or is there another recommended approach to handle this kind of validation directly in the interface?

Thanks in advance for your help.

  Discussion posts and replies are publicly visible