I am building a custom module where the user needs to upload an image. Here is the code for my form:
function floor_map_form($form, &$form_state) {
$form['file'] = array(
'#type ' => 'file',
'#title' => t('Choose a file'),
);
$form['center'] = array(
'#type' => 'textfield',
'#title' => t('Center'),
);
$form['country'] = array(
'#type' => 'textfield',
'#title' => t('Country'),
);
$form['region'] = array(
'#type' => 'textfield',
'#title' => t('Region'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}
The only thing that shows in the browser are the text fields and submit button, the file upload field is nowhere in the page or html for the page.