Skip to main content
Solved

Get a list of filenames based on the user selection?

  • May 6, 2024
  • 2 replies
  • 74 views

virtualcitymatt
Celebrity
Forum|alt.badge.img+47

I’m working on an upload process via REST call and I want to use FME to do the upload.

For the API I need to provide a list of file names in advance. I want this to just work and I want to be able to use FME’s multiple file picker to allow the user to pick folders, multipler files or just a single file. etc.

Does anyone have a good/robust method for getting a full list of the files (and filenames) that this input could be.

My initial plan is to split up the input parameter into a list and then figure out what are folders and what are files and for folders I would use a PATH reader to get the files.

I guess I need a “MultiFilePathResolver” kind of thing.

 

Best answer by hkingsbury

I’d go the way you suggested, figure out what are folders, and then find the files in those folders.

I’d want to set a traversal limit, because if someone selected “C:\” then they’re going to be uploading the entire computer

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+65
  • Celebrity
  • Best Answer
  • May 6, 2024

I’d go the way you suggested, figure out what are folders, and then find the files in those folders.

I’d want to set a traversal limit, because if someone selected “C:\” then they’re going to be uploading the entire computer


virtualcitymatt
Celebrity
Forum|alt.badge.img+47

I’d go the way you suggested, figure out what are folders, and then find the files in those folders.

I’d want to set a traversal limit, because if someone selected “C:\” then they’re going to be uploading the entire computer

Thanks @hkingsbury , and good tip on the limit. Are you speaking from experience…hehe