add conditional to upload of files