Commit 392752e6652003c4789d849232834237a9d13cc6

Authored by Kevin Fourie
1 parent 01acabe0

KTC-7

"On document upload, KnowledgeTree server creates .tmp files in the Windows directory"
Fixed. Temp file is now removed correctly.

Reviewed By: Conrad

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6597 c91229c3-7414-0410-bfa2-8a42b809f60b
ktwebdav/lib/KTWebDAVServer.inc.php
... ... @@ -1261,6 +1261,7 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
1261 1261  
1262 1262 if(PEAR::isError($oDocument)) {
1263 1263 $this->ktwebdavLog("oDocument ERROR: " . $oDocument->getMessage(), 'info', true);
  1264 + unlink($sTempFilename);
1264 1265 return "409 Conflict - " . $oDocument->getMessage();
1265 1266 }
1266 1267  
... ... @@ -1310,11 +1311,13 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
1310 1311  
1311 1312 if(PEAR::isError($oDocument)) {
1312 1313 $this->ktwebdavLog("oDocument ERROR: " . $oDocument->getMessage(), 'info', true);
  1314 + unlink($sTempFilename);
1313 1315 return "409 Conflict - " . $oDocument->getMessage();
1314 1316 }
1315 1317  
1316 1318 $this->ktwebdavLog("oDocument is " . print_r($oDocument, true), 'info', true);
1317 1319  
  1320 + unlink($sTempFilename);
1318 1321 return "201 Created";
1319 1322  
1320 1323 } else return "423 Locked - KTWebDAV is in SafeMode";
... ...