Add a 'filter' option to allow the user to specify a callback function that accepts or rejects files.