Yes you can. You have a few options to do that though.
Using FormData
const formData = new FormData()
formData.append('file', new Blob([fileTextContent], {type: 'text/plain'}))
await axios.post('/upload-file', formData)
Documentation: https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects#creating_a_formdata_object_from_scratch
Set a file <input>
's value
let file = new File([data], "img.jpg",{type:"image/jpeg", lastModified:new Date().getTime()});
let container = new DataTransfer();
container.items.add(file);
fileInputElement.files = container.files;
Then you can submit the form containing the <input>
normally.
The code above is from this SO answer: https://stackoverflow.com/a/66466855/14366961