Q:

zend file transfer checking files

I want to check if a file has been uploaded or not. If not I don't want my form to update this field automatic. If it is uploaded I want this file to be uploaded in my db. Here is the code in my controller. In my form I've got an Zend_Form_Element_File('Document')
$upload = new Zend_File_Transfer();
$data['document'] = $upload->getFileInfo();
foreach ($data['document'] as $file => $info) {
  if ($upload->isUploaded($file)) {
  }
  if (!$upload->isUploaded($file)) {
  }
  // ...?
}

Thanks

A:

Got the answer myself:
if ($data['document'] == null)
{
    unset($data['document']);
}

if nothing is added to the form while editing it. You only have to check if the array is null or not. If $data['document'] == null then you have to unset this $data['document'] so it will not be replaced with null and the old files will still be

