0

I want to upload file from frontend to remote server via PHP and progress bar, how could I do this? May be it is possible without installing extra software on frontend and remote servers?

On frontent server a have apache, PHP On remote server a have nginx, PHP-FPM

4

1 Answer 1

0

you can view this question in details. anyways when you call ajax request from query where is a function called uploadProgress you can call and track the status and percentage on file uploading in server. this function accept four parameters event, position, total, percentComplete

example

$.ajax({
    beforeSend: function() {
         // reset your progress bar here or do anything before making a call to endpoint
    },
    uploadProgress: function(event, position, total, percentComplete) {
        var percentVal = percentComplete + '%';
        $('#progressBar').width(percentVal);
    },
    complete: function(xhr) {
        alert(xhr.responseText);
    }
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.