I want to show a progress bar during form is submitted and processed until submission is created I am using Form API to create a form on a page and I ask user to submit CSV File which is then process in _submit function for that form. Kindly suggest me a way to add progress bar with Drupal's way. I tried this actually but did not work.

function userop_form_users($form_state) {

  $form['file'] = array(
    '#type' =&gt; 'file',
    '#title' =&gt; t("Upload CSV file containing information."),
    '#description' =&gt; t('&lt;a href="#"&gt;Download sample file&lt;/a&gt;.&lt;br&gt;Upload a file, allowed extensions: csv'),
    '#ajax' =&gt; array(
        'progress' =&gt; array('type' =&gt; 'bar', 'message' =&gt; t('TestMessage'),'interval' =&gt; '1500'),
     ),
    );

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

  $form['#cache'] = FALSE;
  return $form;
}
The easiest way would be to use the managed_file field type and set the #progress_indicator property to 'bar'.

More details are given in this Drupal Answers answer...