switch upload and multiupload logic