Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

manchan's avatar

Inertia.post onProgress

Hi,

I am trying the Inertia post and this post may take more than a minute to finish. I would like to display a in progress dialog, but I found that the onProgess method was not call at all. Checking the Inertia document, do I need to create an event and pass to the onProgress method? can anyone give me an example, thank you in advance.

Inertia.post('/generateFile', form, {

    onProgress: () => {
        console.log("onProgress");
        closeConfirmGenerateFileDialog();         
        openGeneratingFileDialog();     

    },
    onSuccess: () => {
        console.log("onSuccess");
        closeConfirmGenerateFileDialog();
        closeGeneratingFileDialog();           
        abaGeneratedSuccessDialog();                   
    },
    onError: () => {
        console.log("onError");
        closeConfirmGenerateFileDialog();
        closeGeneratingFileDialog();
        fileGeneratedFailDialog();
    },
})
0 likes
2 replies
tykus's avatar

The progress event fires as progress increments during file uploads.

Are you actually uploading a file?

manchan's avatar

Hi @tykus, No, the form just included a date, a string and an array. Once the server get the request, it need more than a minute to prepare a file for user download on another page.

Please or to participate in this conversation.