You need to package up a bunch of files, send them somewhere, and do something with them at the destination. It isn’t an uncommon scenario. The obvious answer is to create an archive — a zip or tar ...
Check if a file is really a file, whether a string contains anything, and whether you can run a program with these vital patterns.