By elkin_taharon on
hi, this is my first try with form_alter hook i would like to know if i hava some kind of newbe mistake...
the form is showing the upload file in the form, but it seams to be empty at submit time.
this is my code :
function taharon_form_alter(&$form, $form_state, $form_id) {
switch ($form_id)
{
case 'story_node_form':
$form['imagen'] = array(
'#type' => 'file',
'#title' => 'imagen para el slideshow',
);
$form['#attributes'] = array('enctype' => "multipart/form-data");
$form['#validate'][] = '_validar_imagen_validate';
break;
}
}
function _validar_imagen_validate($form, &$form_state) {
$file = file_save_upload('imagen');
var_dump($form_state);
} Any help?