loop through files for upload