I'm working on a Drupal 7 site and it's been a while so I've forgotten a few things!

I am trying to create a custom module for Filefield Sources which will add multiple files from a specific directory in the file folder. I have a textfield with an autocomplete that a user inserts the directory name (this part works fine) and the idea is that someone then clicks an "Add Files" button and the files are added to the field. All of the files in this folder are already files in Drupal so have a fid etc.

What I'm struggling with is the 'process' part of hook_filefield_sources_info(). I've been looking at other modules - Filefield Sources Plupload for example - and the bundled standard sources but can't really work it out. (I'm too rusty on D7 it seems).

It looks like attaching one file is relatively straightforward but attaching multiple is harder.

Any tips etc. would be greatly appreciated.