Question

Check the extension on input files for FME apps

  • 28 November 2022
  • 9 replies
  • 48 views

How can I check the extension on input files for FME apps

For example a file with a DWG extension

 

Thank you for answer


9 replies

Userlevel 4

You can either use a Tester with an "Ends with" operator set to .e.g. ".dwg" and with comparison mode set to Case Insensitive, or you can use the FilenamePartExtractor transformer first and check for the contents of the "_extension" attribute. The former is easier but the latter gives you a few more options, if you need them later on.

Thank you for answer

But Tester and FilenamePartExtractor run only at the time of processing workbanch. I need check the files extension in the input moment - in gallery apps workspace.

 

Userlevel 4

Thank you for answer

But Tester and FilenamePartExtractor run only at the time of processing workbanch. I need check the files extension in the input moment - in gallery apps workspace.

 

What are you trying to accomplish? Limiting the choice to a specific file extension, or modifiing the app parameters according to the selected file type, or something else?

Limiting the choice (best is restrict input file ) to a specific file extension, becouse when user upload unsupported type of file, the process not work correctly.

Userlevel 4

Limiting the choice (best is restrict input file ) to a specific file extension, becouse when user upload unsupported type of file, the process not work correctly.

You can limit the file selector in the user parameter settings:

imageJust be aware that it's a soft limitation and that the user can still upload whatever they want, if they're motivated. I think the best solution would be a combination of a file selection limiter and an additional check within the workspace to avoid crashes and perhaps even send the user some sort of message/mail.

I already tested this, but this settings not enforced in web enviroment

image

Userlevel 5
Badge +29

You can limit the file selector in the user parameter settings:

imageJust be aware that it's a soft limitation and that the user can still upload whatever they want, if they're motivated. I think the best solution would be a combination of a file selection limiter and an additional check within the workspace to avoid crashes and perhaps even send the user some sort of message/mail.

Yea, even if you set limitations on the parameters its very important to also check against those contraints in the actual proccess. Ideally as the first thing the process does

You can limit the file selector in the user parameter settings:

imageJust be aware that it's a soft limitation and that the user can still upload whatever they want, if they're motivated. I think the best solution would be a combination of a file selection limiter and an additional check within the workspace to avoid crashes and perhaps even send the user some sort of message/mail.

So there is no way to catch the error directly at the moment of inserting the file?

Badge +10

Hi @radek.cervenka​ ,

 

I don't see a way to validate, but I think it's a good suggestion and I made a ticket for the enhancement.

Reply