preprocess upload file