Skip to content

Commit

Permalink
GetDKAN#4273: Datastore MySQL Import handles empty file incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-korn committed Sep 4, 2024
1 parent f0fad05 commit 3134bc5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ protected function runIt() {
return $this->setResultError(sprintf('Unable to resolve file name "%s" for resource with identifier "%s".', $this->resource->getFilePath(), $this->resource->getId()));
}

$size = @filesize($file_path);
if (!$size) {
return $this->setResultError("Can't get size from file {$file_path}");
}

// Read the columns and EOL character sequence from the CSV file.
$delimiter = $this->resource->getMimeType() == 'text/tab-separated-values' ? "\t" : ',';
try {
Expand Down

0 comments on commit 3134bc5

Please sign in to comment.