I suppose you're asking how to code a program that does this automatically, right? I would probably write a "server" which polls a specified directory every n seconds to see whether there are new files available, and then process any new files according to what needs to be done.