Skip to content

Commit

Permalink
Remove temporary files after file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
withanage authored and asmecher committed Sep 27, 2019
1 parent da86d0e commit 8a0b0bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions TextureHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,11 @@ protected function _createDependentFile($genreId, $mediaData, $submission, $subm
$newMediaFile->setAssocId($submissionFile->getFileId());
$newMediaFile->setAssocType(ASSOC_TYPE_SUBMISSION_FILE);
$newMediaFile->setOriginalFileName($mediaData["fileName"]);
$insertedMediaFile = $submissionFileDao->insertObject($newMediaFile, $tmpfname);

return $submissionFileDao->insertObject($newMediaFile, $tmpfname);
unlink($tmpfname);

return $insertedMediaFile;
}

/**
Expand Down Expand Up @@ -452,8 +455,11 @@ protected function _updateManuscriptFile($fileStage, $genreId, $resources, $subm
$newSubmissionFile->setSourceRevision($submissionFile->getRevision());
$newSubmissionFile->setFileId($submissionFile->getFileId());
$newSubmissionFile->setRevision($submissionFile->getRevision() + 1);
$insertedSubmissionFile = $submissionFileDao->insertObject($newSubmissionFile, $tmpfname);

unlink($tmpfname);

return $submissionFileDao->insertObject($newSubmissionFile, $tmpfname);
return $insertedSubmissionFile;
}

/**
Expand Down

0 comments on commit 8a0b0bb

Please sign in to comment.