How to read file submitted through file field in block configure form I have created a block through custom module and added file field in block configuration form using below code.

function mymodule_block_configure($delta){
if($delta=='mymodule'){
    $form = array();
    $form['mymodule_file']=array(
        '#type'=&gt;'file',
        '#title'=&gt;'Upload text file',
        '#name'=&gt;'files[sample]',

    );      
    return $form;
      }
 }


When I try to check this field in hook_block_save, the form element is empty even when the form is submitted after browsing the file.

 function mumodule_block_save($delta,$edit=array()){
    if($delta=='mymodule_block'){
    dpm($edit); 
    }
     }


$edit['mymodule_file'] is empty after the form is submitted. 

Am I missing anything?
You want to use the #type 'managed_file' instead of just file: http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7#managed_file.

That will then automatically save the file and create a row in {file_managed}, You just need to set it as permament, as explained in the link above and then save the fid, for example with variable_set().

You can also set the #default_value for the fid, and it will display the field again.