'value', '#value' => $mimetype, ); $form['#submit'] = array('media_metadata_form_submit'); } function media_metadata_form_submit($form, &$form_state) { $mimetype = $form_state['values']['mimetype']; $keys = media_metadata_keys($mimetype); $values = array(); foreach ($keys as $key) { $values[$key] = $form_state['values'][$key]; } // @TODO: Grab the file info and save the record. }