Answered by R. SR. S on stackoverflowstackoverflow
In your saveAction
of you controller you need to check if the delete image
checkbox is check.
Eg.
if (isset($_FILES['checkcsv']['name']) && $_FILES['checkcsv']['name'] != '') {
try {
...
$uploader->save($path, $logoName);
save path to database
} catch (Exception $e) {
}
}
else if((isset($data['banner']['delete']) && $data['banner']['delete'] == 1)){
//set path to null and save to database
$data['banner'] = '';
//can also delete file from fs
unlink(Mage::getBaseDir('media') . DS . $data['banner']['value']);
}