Solved

Get a list of filenames based on the user selection?


Userlevel 5
Badge +28

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.

 

icon

Best answer by hkingsbury 6 May 2024, 22:19

View original

2 replies

Userlevel 5
Badge +29

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

Userlevel 5
Badge +28

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

 

 

Reply