File extension validator


We need to create two file attribute fields/fragments: one allows for all file types as per the object’s settings, the other needs a validator which should only allow for .jpg, .jpeg files. After selecting the file, I’m having a problem getting its value using fragment_presenter.get_value(). A call to cs.log shows nothing. I was wondering if the change implemented in v 2021.2 has caused this? The change is described in this post:

Limiting file type on File attribute type - Liberty Create - Build Advice - Netcall Community

If not, does anyone have an example of this ?

Thanks, Mark

Hi Mark, I will try to get a Developer to assist you with this! Regards - MP

1 Like

Hi Mark, is there any update on this ?
Regards, Mark

Hi Mark, I apologise for the delay but all our Devs have been very busy working on getting or 2023.1 platform version launched. I have asked again and someone is looking at it shortly. I will respond once they get back to me. Regards - MP

Morning Mark,

I’m unusure of the reason, but it appears, that as you say, get_value() fails to return the file name shown in the UI.
I have raised this with our core team and will let you know when I get an answer.

Many Thanks

Adam Mills

This issue has now been resolved and the patch is available in all versions back to 21.2.
The get_value() method will return a filename in this pre-saved context.
It is worth noting that in the saved context a file_id will be returned that will need to be resolved.

Let me know if you have any issues.

1 Like