I actually had this working but after many changes to the form It no longer works

It seems the file_save_upload function is not happening
the below if statement does not execute and I get else executing instead

I am pulling my hair out on this one, and I dont know where to get errror messages that might help

Also I have set the files/fundraiser directory permissions to create/delete everyone

Help please

relevant snippits from my form

$form['#attributes'] =array('enctype' => "multipart/form-data");

$form['fundraiser']['image'] = array(
'#type' => 'file',
'#title' => t('Photo/logo'),
'#name'=> 'logo_field',
'#description'=> t('(*)'),
'#size' => 30,
'#description' => t('(For display on the header of your online store)'),
);

From my submit function

$validators = array( 'file_validate_extensions' => array( 'png','gif','jpg','jpeg') );

$source = logo_field;

if($file = file_save_upload($source,$validators,file_directory_path().'/fundraiser')){

$logo = $file->filepath;
} else {
die(print "else executed");
}

Comments

jabberwok’s picture

Please I really need some help with this, anyone?