Debug v21 error when failed to write file

This commit is contained in:
ldestailleur
2025-03-01 18:37:06 +01:00
parent db3780d70d
commit b49b676fcb

View File

@@ -1573,9 +1573,15 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
dol_mkdir(dirname($filetosave));
$fp = fopen($filetosave, "w");
fwrite($fp, $tmpgeturl['content']);
fclose($fp);
dolChmod($filetosave);
if ($fp) {
fwrite($fp, $tmpgeturl['content']);
fclose($fp);
dolChmod($filetosave);
} else {
$error++;
setEventMessages('Error failed to open file '.$filetosave.' for writing', null, 'errors');
$action = 'create';
}
}
}
}