How to create Block configuration form
You can create block configuration page using hook_block_configure().
where you can create form with your required field like textfield, file etc.

function demo_block_configure($delta = '') {
    $form = array();
    if ($delta == 'demo') {
        $form['demo_number'] = array(
            '#type' =&gt; 'textfield',
            '#title' =&gt; t('Number of nodes you want the block to show'),
            '#default_value' =&gt; variable_get('demo_number', 10),
            '#size' =&gt; 60,
        );
    }
    return $form;
}

function demo_block_save($delta = '', $edit = array()) {
    if ($delta == 'demo') {
        variable_set('demo_number', $edit['demo_number']);
    }
}


now you can get this variable using variable_get function

$no_of_block = variable_get('demo_number');


you can see this page in configuration of your block