I did not find a solution using original Bootstrap entry. However, I used some tricks and made it just like I changed the text of file input form. I will use the sample you gave to show how I did it.
This is a input form from form-control of Bootstrap Docs.
Code is this:
<div class="mb-3">
<label for="formFile" class="form-label">Default file input example</label>
<input class="form-control" type="file" id="formFile">
</div>
The thought is to replace file input tag
with text input tag
, and use Javascript to bind file input form action.
<!-- use online bootstrap resource -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="mb-3">
<label for="file_input_id" class="form-label">Default file input example</label>
<!-- use opacity and height style to hide file input form -->
<input class="form-control" type="file" id="file_input_id" style="opacity:0;height:0;">
<!-- use another text input group to replace file input form -->
<div class="input-group mb-3">
<span class="input-group-text" id="text_input_span_id">Any text here</span>
<!-- use 'caret-color: transparent' to hide input cursor, set autocomplete to off to remove possible input hint -->
<input type="text" id='text_input_id' class="form-control" placeholder="Another text here" style="caret-color: transparent" autocomplete="off">
</div>
</div>
<!-- use online jQuery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
// bind file-input-form click action to text-input-span
$('#text_input_span_id').click(function () {
$("#file_input_id").trigger('click');
})
// bind file-input-form click action to text-input-form
$('#text_input_id').click(function () {
$("#file_input_id").trigger('click');
})
// display file name in text-input-form
$("#file_input_id").change(function () {
$('#text_input_id').val(this.value.replace(/C:\\fakepath\\/i, ''))
})
</script>
Click the input form and choose a file, it works!

If you want to change the button to the right, just change the order of span and input tags.