Hi friends,

I am customizing my "Site Information" page via my own module (variousoverrides.module), it serves more like site config page at this point. I added a bunch of text-variables:

		/*
		 * SITE INFORMATION: adding another box for home page text box
		 */	
		$form['homepageConfig']['site_home_page_text_box'] = array(
		   '#type' => 'textarea',
		   '#title' => t('Home page text box'),
		   '#default_value' => variable_get('site_home_page_text_box', ''),
		   '#description' => t('This text will appear on home page only under a main photograph. If text will not fit in a box, a scroll bar will appear.')
		);

I also added file upload, like a splash page image:

		/*
		 * adding picture upload
		 */		
		$form['homepageConfig']['site_home_page_pic'] = array(
		'#type' => 'file',
		'#title' => t('Upload Picture'),
		'#description' => t('photograph (650x323px)'),
	   '#default_value' => variable_get('site_home_page_pic', ''),
		'#required' => FALSE,
		);

The problem is: while text-based items are stored and retrieved automatically, it doesn't work with file uploads. I realise I need to hook to _form_submit to handle file uploads is that correct?

If so, can anyone please hint at how do I hook to that submit? I tried a lot of techniques but I just can't figure out how to do this.

Any help will be appreciated,
Thanks,
Vlad

Comments

f1vlad’s picture

Still looking for help how to handle file uploaded from "Site information" page, anyone?