Insee : check integrity

This commit is contained in:
Michael RICOIS 2016-03-14 08:30:37 +00:00
parent 98b0c533fb
commit 7006862c68

View File

@ -113,7 +113,9 @@ if ($opts->cron || $oneShot) {
echo date('Y-m-d H:i:s') . " - Telechargement $file\n";
$command = "cd $storageDir; curl -s -S $FTP_OPTION -O " . $FTP_URL . $file;
exec($command);
if (file_exists($storageDir.'/'.$file)) {
// --- Test integrity
exec('unzip -t '.$storageDir.'/'.$file, $output, $integrity);
if ($integrity == 0 && file_exists($storageDir.'/'.$file)) {
$type = 'insee';
$ftpSize = filesize($storageDir.'/'.$file);
$ftpDate = date ("YmdHis", filemtime($storageDir.'/'.$file));