if (!$img or $img['error'] !== UPLOAD_ERR_OK)
throw new Exception('bestand niet goed ontvangen: '.$img['error']);
$datadir = implode('/', ['data', date('Y')]);
if (!$img or $img['error'] !== UPLOAD_ERR_OK)
throw new Exception('bestand niet goed ontvangen: '.$img['error']);
$datadir = implode('/', ['data', date('Y')]);
if (!file_exists($datadir) and !@mkdir($datadir, 0777, TRUE)) {
throw new Exception("bestand kon niet geplaatst worden in $datadir");
}
$target = $datadir.'/'.$img['name'];
if (!file_exists($datadir) and !@mkdir($datadir, 0777, TRUE)) {
throw new Exception("bestand kon niet geplaatst worden in $datadir");
}
$target = $datadir.'/'.$img['name'];
if (!@move_uploaded_file($img['tmp_name'], $target)) {
throw new Exception('bestand kon niet worden opgeslagen');
}
if (!@move_uploaded_file($img['tmp_name'], $target)) {
throw new Exception('bestand kon niet worden opgeslagen');
}