Hi all, I'm having an awful time with this one. I'm putting in module development because it is occurring in a custom module, it's borderline post-installation so please advise if it should be moved there
Using a module I have a custom content type. Using hook_form the form is showing just fine, all fields included. When I submit the form, using form_submit(), I am dumping the values so that I can see them. All values are included in $form_state['values'] except the ones from the file fields, they're just empty. I also checked in $form_state['clicked_button'] and same thing. I have verified that enctype = multipart/form-data. See below for the code that includes the file fields.
I'm not sure if this plays a role at all, but I am including the form on a custom page using (in hook_nodeapi(); parts removed for brevity):
if ($node->nid == 18) {
.
.
.
$new_mats_product = new stdClass();
$new_mats_product->type = 'mats_product';
module_load_include('inc', 'node', 'node.pages');
$too_late ? '' : $node->content['body']['#value'] .= drupal_get_form('mats_product_node_form', $new_mats_product);
$form['images'] = array(
'#type' => 'fieldset',
'#title' => t('Upload images'),
'#description' => t('Up to 3 images are allowed'),
);
$form['images']['image_upload1'] = array(
'#type' => 'file',
'#title' => t('Image upload'),
);
$form['images']['image_upload2'] = array(
'#type' => 'file',
'#title' => t('Image upload'),
);
$form['images']['image_upload3'] = array(
'#type' => 'file',
'#title' => t('Image upload'),
);Thanks for taking a look, I appreciate any suggestions.
Comments
Take a look at the $_FILES
Take a look at the $_FILES array.
Sorry and thank you
I suck for not realizing that.