Skip to content

Commit

Permalink
add check on tmp file if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier committed Feb 21, 2019
1 parent 55d906f commit d6ba416
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Charcoal/Property/FileProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ public function dataUpload($fileData)
if (is_array($fileData)) {
// retrieve tmp file from temp dir
$tmpFile = sys_get_temp_dir() . $fileData['id'];
if (!file_exists($tmpFile)) {
throw new Exception(
'File does not exists.'
);
}
$fileContent = file_get_contents($tmpFile);
$filename = (!empty($fileData['name'])) ? $fileData['name'] : null;
// delete tmp file
Expand Down

0 comments on commit d6ba416

Please sign in to comment.