Only send files to upload, not directories. Fixes issue 5030