From e456bb951b47f34490978d99b1db4af8db3a6a9c Mon Sep 17 00:00:00 2001 From: megan_w Date: Wed, 28 Nov 2007 12:22:48 +0000 Subject: [PATCH] Merged in from DEV trunk... --- lib/documentmanagement/documentutil.inc.php | 4 ++-- lib/storage/ondiskhashedstoragemanager.inc.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/documentmanagement/documentutil.inc.php b/lib/documentmanagement/documentutil.inc.php index 682cc3b..47c5007 100644 --- a/lib/documentmanagement/documentutil.inc.php +++ b/lib/documentmanagement/documentutil.inc.php @@ -580,8 +580,8 @@ class KTDocumentUtil { } KTDocumentUtil::setComplete($oDocument, 'contents'); - if ($aOptions['cleanup_initial_file']) { - //@unlink($sFilename); + if ($aOptions['cleanup_initial_file'] && file_exists($sFilename)) { + @unlink($sFilename); } return true; diff --git a/lib/storage/ondiskhashedstoragemanager.inc.php b/lib/storage/ondiskhashedstoragemanager.inc.php index 426fbff..1c7cf12 100644 --- a/lib/storage/ondiskhashedstoragemanager.inc.php +++ b/lib/storage/ondiskhashedstoragemanager.inc.php @@ -59,8 +59,10 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { global $default; $default->log->info(sprintf("Uploaded %d byte file in %.3f seconds", $file_size, $end_time - $start_time)); - //remove the temporary file - @unlink($sTmpFilePath); + //remove the temporary file if it was uploaded + if (is_uploaded_file($sTmpFilePath)){ + @unlink($sTmpFilePath); + } if (file_exists($sDocumentFileSystemPath)) { return true; } else { -- libgit2 0.21.4