<form name="person" method="P">
    <input name="name" value="John">
    <input name="surname" value="Smith">
    <input type="file" class="form-control" onchange="upload(this.files[0])"></input>
    <input type="submit">
</form>
<script>
    function upload(file) {
        alert("el proceso va a empezar");
        let xhr = new XMLHttpRequest();
        var formData = new FormData();
        formData.append("fileToUpload", file);
        xhr.upload.onprogress = function(event) {
            console.log(`Uploaded ${event.loaded} of ${event.total}`);
        };

        // seguimiento completado: sea satisfactorio o no
        xhr.onloadend = function() {
            if (xhr.status == 200) {
                console.log("Logrado");
            } else {
                console.log("error " + this.status);
            }
        };

        xhr.open("POST", "./incertar-proveedor.php");
        xhr.send(formData);
    }
</script>