I received a form with only one field. This field is of type "managed_field". When you click the "Download" button, a progress bar will show you the file download progress. After that, you will need to submit a form to save the file.
Since the progress bar will not be displayed when you select the file, then click the "Submit Form" button instead of the "Download" button. I would like to start submitting the form after the download is completed (via the "Download" button).
My current form is as follows:
$form['#attributes'] = array('enctype' => "multipart/form-data");
$form['pdf_upload'] = array(
'#title' => t('Upload PDF'),
'#type' => 'managed_file',
'#required' => TRUE,
'#progress_message' => t('Please wait...'),
'#progress_indicator' => 'bar',
'#upload_validators' => array(
'file_validate_extensions' => array('pdf'),
)
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
The file module processes files through an ajax callback for the file / ajax / * uri. The callback returns ajax commands.
ajax, .