Skip to main content
Question

Check the extension on input files for FME apps

  • November 28, 2022
  • 12 replies
  • 373 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

12 replies

david_r
Celebrity
  • November 28, 2022

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.

 


david_r
Celebrity
  • November 28, 2022

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.


david_r
Celebrity
  • November 28, 2022

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


hkingsbury
Celebrity
Forum|alt.badge.img+73
  • Celebrity
  • November 28, 2022

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?


richardatsafe
Safer
Forum|alt.badge.img+11

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.


pkno
Contributor
Forum|alt.badge.img+5
  • Contributor
  • July 23, 2026

 

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.

@richardatsafe 

I am facing the same problem: Trying to enforce a file extension check before a file is uploaded and send to the workspace. Was this enhancement ever implemented or is there another solution to this?


richardatsafe
Safer
Forum|alt.badge.img+11

@pkno Unfortunately, this enhancement has not been taken up yet, and were left with the suggestions in this thread. Your comments do help the priority of the enhancement though, so thanks for voicing your needs.


tb09114
Enthusiast
Forum|alt.badge.img+28
  • Enthusiast
  • July 29, 2026

If you move to a custom-coded app that talks to the FME Flow REST API/Web Services directly (rather than using the no-code Gallery/App builder), you get full control over the <input type=”file”> element in JavaScript.
There is also a tutorial from Safe about this.
You read fileInput.files[0] before calling the Data Upload Service (fmedataupload) endpoint, then submit the job via the Job Submitter/Data Download Service. Since you own that code, you can check fileInput.files[0].name (or .type) in handleSubmit/uploadFile and block the request client-side before it ever reaches FME Flow.

Though keep in mind, also this is still a client-side check, and there’s no server-side enforcement on the upload or job-submission endpoints. Someone hitting the API directly (curl, Postman, another script) bypasses your JS entirely. For actual enforcement you still need a check inside the workspace itself.