preparing files for upload