Add upload/processing status bar/throbber I am new to Drupal/web development and I have been trying to create a module to add files upload menu. Once the files are uploaded, they undergo processing and a message is displayed upon completion of the process. Everything works well but I would like to add a processing progress bar/throbber from the tile Submit button is selected to when the final output is displayed. I am clueless on how to implement this. Any help is appreciated
Here's part of the code I used:
//Before this part of the code, there is function to create Menu ($items[])
function g_p_proc_form($form, &amp;$form_state, $values) {
    $form['#attributes']['enctype'] = 'multipart/form-data';
    $form['filter'] = array (
        &quot;#type&quot; =&gt; &quot;fieldset&quot;,
        &quot;#title&quot; =&gt; t(&quot;File Process &lt;BR&gt; &quot;),
        &quot;#collapsible&quot; =&gt; TRUE,
    );
  // without this attribute, upload may fail on submit
    $form['#attributes']['enctype'] = 'multipart/form-data';
    $form['filter']['file'] = array(
        // '#title' =&gt; t('File processing'),
        '#type'  =&gt; 'file',
        '#name' =&gt; 'files[]',
        '#description' =&gt; t('Select Submit to start processing the file'),
        '#type'  =&gt; 'file'),
        '#upload_location' =&gt; 'public://',
        '#attributes' =&gt; array('multiple' =&gt; 'multiple'),
    );

    $form['filter']['submit_upload'] = array(
        '#type'  =&gt;  'submit', 
        '#value' =&gt;  t('Submit'),

    );


    // drupal_set_message(t(&quot;in fn&quot;));

    return $form;
}

function g_p_proc_form_submit($form, &amp;$form_state) {
    try{
        $number_file = count($_FILES['files']['name']);
        $f_name = array();
        for ($i=0; $i&lt;$number_file;$i++)
        {
            $file = file_save_upload($i, array('file_validate_extensions' =&gt; array('pdf PDF')), 'public://', FILE_EXISTS_REPLACE);
            $f_name[] = $_FILES['files']['name'][$i]; //[]
        }
            }catch (Exception $error){
        echo 'Exception: ',  $error-&gt;getMessage(), &quot;\n&quot;;
    }
    $n_f = count($f_name);
    drupal_set_message(t('Number of files: !n_f', array('!number_f'=&gt;$n_f)));
    $fn_name = 'g_p';
    $fn_call = $fn_name($f_name);
function g_p($f_name=array()){
    $curr_l = getcwd();
    chdir('My file processing PHP script location ');
    $n_f = count($f_name);
    $shell_command = shell_exec(&quot;file_processing_php_script_name.php&quot;);
    //header(&quot;Location: &quot;Current file processing module menu site&quot;); //Commented out
    drupal_set_message($shell_command);
    chdir($curr_l);
}
    

As it can be seen from the code, I process the files upon upload and display the output message after processing. I would like to add a throbber/processing-progress bar from the time Submit is selected to the time the output is displayed, after the files are processed. How can I achieve this? Again, please understand that I am new to web development/Drupal and am not very proficient in terms/commands used in them.
Change from file to manager_file and use property #progress_indicator (by default is already set so you won't have to add it).
https://api.drupal.org/api/drupal/developer%21topics%21forms_api_reference.html/7.x#managed_file