Add upload_file api method.