Commit 6af4e62d6505d332b381a45c0ae8a35404007bcc
1 parent
58c7b861
KTS-2721
"Refactor adding a document to use the storage manager" Fixed. Removed all references to KTFSFileLike. Added a function to the storagemanager for uploading a temp file. Committed by: Megan Watson Reviewed by: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7731 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
5 changed files
with
89 additions
and
53 deletions
ktapi/KTAPIFolder.inc.php
| @@ -478,7 +478,8 @@ class KTAPI_Folder extends KTAPI_FolderItem | @@ -478,7 +478,8 @@ class KTAPI_Folder extends KTAPI_FolderItem | ||
| 478 | 478 | ||
| 479 | 479 | ||
| 480 | $options = array( | 480 | $options = array( |
| 481 | - 'contents' => new KTFSFileLike($tempfilename), | 481 | + //'contents' => new KTFSFileLike($tempfilename), |
| 482 | + 'temp_file' => $tempfilename, | ||
| 482 | 'novalidate' => true, | 483 | 'novalidate' => true, |
| 483 | 'documenttype' => DocumentType::get($documenttypeid), | 484 | 'documenttype' => DocumentType::get($documenttypeid), |
| 484 | 'description' => $title, | 485 | 'description' => $title, |
ktwebdav/lib/KTWebDAVServer.inc.php
| @@ -1371,9 +1371,10 @@ class KTWebDAVServer extends HTTP_WebDAV_Server | @@ -1371,9 +1371,10 @@ class KTWebDAVServer extends HTTP_WebDAV_Server | ||
| 1371 | ); | 1371 | ); |
| 1372 | $this->ktwebdavLog("aFileArray is " . print_r($aFileArray, true), 'info', true); | 1372 | $this->ktwebdavLog("aFileArray is " . print_r($aFileArray, true), 'info', true); |
| 1373 | 1373 | ||
| 1374 | - include_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); | 1374 | + //include_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); |
| 1375 | $aOptions = array( | 1375 | $aOptions = array( |
| 1376 | - 'contents' => new KTFSFileLike($sTempFilename), | 1376 | + //'contents' => new KTFSFileLike($sTempFilename), |
| 1377 | + 'temp_file' => $sTempFilename, | ||
| 1377 | 'metadata' => array(), | 1378 | 'metadata' => array(), |
| 1378 | 'novalidate' => true, | 1379 | 'novalidate' => true, |
| 1379 | ); | 1380 | ); |
| @@ -1427,9 +1428,10 @@ class KTWebDAVServer extends HTTP_WebDAV_Server | @@ -1427,9 +1428,10 @@ class KTWebDAVServer extends HTTP_WebDAV_Server | ||
| 1427 | ); | 1428 | ); |
| 1428 | $this->ktwebdavLog("aFileArray is " . print_r($aFileArray, true), 'info', true); | 1429 | $this->ktwebdavLog("aFileArray is " . print_r($aFileArray, true), 'info', true); |
| 1429 | 1430 | ||
| 1430 | - include_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); | 1431 | + //include_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); |
| 1431 | $aOptions = array( | 1432 | $aOptions = array( |
| 1432 | - 'contents' => new KTFSFileLike($sTempFilename), | 1433 | + //'contents' => new KTFSFileLike($sTempFilename), |
| 1434 | + 'temp_file' => $sTempFilename, | ||
| 1433 | 'metadata' => array(), | 1435 | 'metadata' => array(), |
| 1434 | 'novalidate' => true, | 1436 | 'novalidate' => true, |
| 1435 | ); | 1437 | ); |
lib/documentmanagement/documentutil.inc.php
| @@ -234,7 +234,7 @@ class KTDocumentUtil { | @@ -234,7 +234,7 @@ class KTDocumentUtil { | ||
| 234 | function &_add($oFolder, $sFilename, $oUser, $aOptions) { | 234 | function &_add($oFolder, $sFilename, $oUser, $aOptions) { |
| 235 | global $default; | 235 | global $default; |
| 236 | 236 | ||
| 237 | - $oContents = KTUtil::arrayGet($aOptions, 'contents'); | 237 | + //$oContents = KTUtil::arrayGet($aOptions, 'contents'); |
| 238 | $aMetadata = KTUtil::arrayGet($aOptions, 'metadata', null, false); | 238 | $aMetadata = KTUtil::arrayGet($aOptions, 'metadata', null, false); |
| 239 | $oDocumentType = KTUtil::arrayGet($aOptions, 'documenttype'); | 239 | $oDocumentType = KTUtil::arrayGet($aOptions, 'documenttype'); |
| 240 | $sDescription = KTUtil::arrayGet($aOptions, 'description', $sFilename); | 240 | $sDescription = KTUtil::arrayGet($aOptions, 'description', $sFilename); |
| @@ -256,20 +256,20 @@ class KTDocumentUtil { | @@ -256,20 +256,20 @@ class KTDocumentUtil { | ||
| 256 | 'documenttypeid' => $iDocumentTypeId, | 256 | 'documenttypeid' => $iDocumentTypeId, |
| 257 | )); | 257 | )); |
| 258 | 258 | ||
| 259 | - if (is_null($oContents)) { | ||
| 260 | - $res = KTDocumentUtil::setIncomplete($oDocument, 'contents'); | ||
| 261 | - if (PEAR::isError($res)) { | ||
| 262 | - $oDocument->delete(); | ||
| 263 | - return $res; | ||
| 264 | - } | ||
| 265 | - } else { | 259 | +// if (is_null($oContents)) { |
| 260 | +// $res = KTDocumentUtil::setIncomplete($oDocument, 'contents'); | ||
| 261 | +// if (PEAR::isError($res)) { | ||
| 262 | +// $oDocument->delete(); | ||
| 263 | +// return $res; | ||
| 264 | +// } | ||
| 265 | +// } else { | ||
| 266 | // $oUploadChannel->sendMessage(new KTUploadGenericMessage(_kt('Storing contents'))); | 266 | // $oUploadChannel->sendMessage(new KTUploadGenericMessage(_kt('Storing contents'))); |
| 267 | - $res = KTDocumentUtil::storeContents($oDocument, $oContents, $aOptions); | 267 | + $res = KTDocumentUtil::storeContents($oDocument, '', $aOptions); |
| 268 | if (PEAR::isError($res)) { | 268 | if (PEAR::isError($res)) { |
| 269 | $oDocument->delete(); | 269 | $oDocument->delete(); |
| 270 | return $res; | 270 | return $res; |
| 271 | } | 271 | } |
| 272 | - } | 272 | +// } |
| 273 | 273 | ||
| 274 | if (is_null($aMetadata)) { | 274 | if (is_null($aMetadata)) { |
| 275 | $res = KTDocumentUtil::setIncomplete($oDocument, 'metadata'); | 275 | $res = KTDocumentUtil::setIncomplete($oDocument, 'metadata'); |
| @@ -694,7 +694,7 @@ class KTDocumentUtil { | @@ -694,7 +694,7 @@ class KTDocumentUtil { | ||
| 694 | /** | 694 | /** |
| 695 | * Stores contents (filelike) from source into the document storage | 695 | * Stores contents (filelike) from source into the document storage |
| 696 | */ | 696 | */ |
| 697 | - function storeContents(&$oDocument, $oContents, $aOptions = null) { | 697 | + function storeContents(&$oDocument, $oContents = null, $aOptions = null) { |
| 698 | if (is_null($aOptions)) { | 698 | if (is_null($aOptions)) { |
| 699 | $aOptions = array(); | 699 | $aOptions = array(); |
| 700 | } | 700 | } |
| @@ -704,17 +704,20 @@ class KTDocumentUtil { | @@ -704,17 +704,20 @@ class KTDocumentUtil { | ||
| 704 | $oKTConfig =& KTConfig::getSingleton(); | 704 | $oKTConfig =& KTConfig::getSingleton(); |
| 705 | $sBasedir = $oKTConfig->get('urls/tmpDirectory'); | 705 | $sBasedir = $oKTConfig->get('urls/tmpDirectory'); |
| 706 | 706 | ||
| 707 | - $sFilename = tempnam($sBasedir, 'kt_storecontents'); | ||
| 708 | - $oOutputFile = new KTFSFileLike($sFilename); | ||
| 709 | - $res = KTFileLikeUtil::copy_contents($oContents, $oOutputFile); | ||
| 710 | - if (($res === false)) { | ||
| 711 | - return PEAR::raiseError(_kt("Couldn't store contents, and no reason given.")); | ||
| 712 | - } else if (PEAR::isError($res)) { | ||
| 713 | - return PEAR::raiseError(sprintf(_kt("Couldn't store contents: %s"), $res->getMessage())); | ||
| 714 | - } | 707 | + $sFilename = (isset($aOptions['temp_file'])) ? $aOptions['temp_file'] : tempnam($sBasedir, 'kt_storecontents'); |
| 708 | + | ||
| 709 | +// $oOutputFile = new KTFSFileLike($sFilename); | ||
| 710 | +// $res = KTFileLikeUtil::copy_contents($oContents, $oOutputFile); | ||
| 711 | +// if (($res === false)) { | ||
| 712 | +// return PEAR::raiseError(_kt("Couldn't store contents, and no reason given.")); | ||
| 713 | +// } else if (PEAR::isError($res)) { | ||
| 714 | +// return PEAR::raiseError(sprintf(_kt("Couldn't store contents: %s"), $res->getMessage())); | ||
| 715 | +// } | ||
| 716 | + | ||
| 715 | $sType = KTMime::getMimeTypeFromFile($sFilename); | 717 | $sType = KTMime::getMimeTypeFromFile($sFilename); |
| 716 | $iMimeTypeId = KTMime::getMimeTypeID($sType, $oDocument->getFileName()); | 718 | $iMimeTypeId = KTMime::getMimeTypeID($sType, $oDocument->getFileName()); |
| 717 | $oDocument->setMimeTypeId($iMimeTypeId); | 719 | $oDocument->setMimeTypeId($iMimeTypeId); |
| 720 | + | ||
| 718 | $res = $oStorage->upload($oDocument, $sFilename); | 721 | $res = $oStorage->upload($oDocument, $sFilename); |
| 719 | if ($res === false) { | 722 | if ($res === false) { |
| 720 | return PEAR::raiseError(sprintf(_kt("Couldn't store contents: %s"), _kt('No reason given'))); | 723 | return PEAR::raiseError(sprintf(_kt("Couldn't store contents: %s"), _kt('No reason given'))); |
| @@ -725,7 +728,7 @@ class KTDocumentUtil { | @@ -725,7 +728,7 @@ class KTDocumentUtil { | ||
| 725 | KTDocumentUtil::setComplete($oDocument, 'contents'); | 728 | KTDocumentUtil::setComplete($oDocument, 'contents'); |
| 726 | 729 | ||
| 727 | if ($aOptions['cleanup_initial_file']) { | 730 | if ($aOptions['cleanup_initial_file']) { |
| 728 | - @unlink($oContents->sFilename); | 731 | + @unlink($sFilename); |
| 729 | } | 732 | } |
| 730 | 733 | ||
| 731 | return true; | 734 | return true; |
lib/storage/ondiskhashedstoragemanager.inc.php
| @@ -8,32 +8,32 @@ | @@ -8,32 +8,32 @@ | ||
| 8 | * KnowledgeTree Open Source Edition | 8 | * KnowledgeTree Open Source Edition |
| 9 | * Document Management Made Simple | 9 | * Document Management Made Simple |
| 10 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 10 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 11 | - * | 11 | + * |
| 12 | * This program is free software; you can redistribute it and/or modify it under | 12 | * This program is free software; you can redistribute it and/or modify it under |
| 13 | * the terms of the GNU General Public License version 3 as published by the | 13 | * the terms of the GNU General Public License version 3 as published by the |
| 14 | * Free Software Foundation. | 14 | * Free Software Foundation. |
| 15 | - * | 15 | + * |
| 16 | * This program is distributed in the hope that it will be useful, but WITHOUT | 16 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 18 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 18 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 19 | * details. | 19 | * details. |
| 20 | - * | 20 | + * |
| 21 | * You should have received a copy of the GNU General Public License | 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 23 | - * | 23 | + * |
| 24 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 24 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 25 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 25 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 26 | - * | 26 | + * |
| 27 | * The interactive user interfaces in modified source and object code versions | 27 | * The interactive user interfaces in modified source and object code versions |
| 28 | * of this program must display Appropriate Legal Notices, as required under | 28 | * of this program must display Appropriate Legal Notices, as required under |
| 29 | * Section 5 of the GNU General Public License version 3. | 29 | * Section 5 of the GNU General Public License version 3. |
| 30 | - * | 30 | + * |
| 31 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 31 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 32 | * these Appropriate Legal Notices must retain the display of the "Powered by | 32 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 33 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 33 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 34 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 34 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 35 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 36 | - * copyright notice. | 35 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 36 | + * copyright notice. | ||
| 37 | * Contributor( s): ______________________________________ | 37 | * Contributor( s): ______________________________________ |
| 38 | */ | 38 | */ |
| 39 | 39 | ||
| @@ -77,6 +77,29 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { | @@ -77,6 +77,29 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { | ||
| 77 | } | 77 | } |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | + /** | ||
| 81 | + * Upload a temporary file | ||
| 82 | + * | ||
| 83 | + * @param unknown_type $sUploadedFile | ||
| 84 | + * @param unknown_type $sTmpFilePath | ||
| 85 | + * @return unknown | ||
| 86 | + */ | ||
| 87 | + function uploadTmpFile($sUploadedFile, $sTmpFilePath) { | ||
| 88 | + | ||
| 89 | + //copy the file accross | ||
| 90 | + if (OS_WINDOWS) { | ||
| 91 | + $sTmpFilePath = str_replace('\\','/',$sTmpFilePath); | ||
| 92 | + } | ||
| 93 | + if ($this->writeToFile($sUploadedFile, $sTmpFilePath)) { | ||
| 94 | + if (file_exists($sTmpFilePath)) { | ||
| 95 | + return true; | ||
| 96 | + } else { | ||
| 97 | + return false; | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + return false; | ||
| 101 | + } | ||
| 102 | + | ||
| 80 | function writeToFile($sTmpFilePath, $sDocumentFileSystemPath) { | 103 | function writeToFile($sTmpFilePath, $sDocumentFileSystemPath) { |
| 81 | // Make it easy to write compressed/encrypted storage | 104 | // Make it easy to write compressed/encrypted storage |
| 82 | 105 | ||
| @@ -318,7 +341,7 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { | @@ -318,7 +341,7 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { | ||
| 318 | $sDocumentRoot = $oConfig->get('urls/documentRoot'); | 341 | $sDocumentRoot = $oConfig->get('urls/documentRoot'); |
| 319 | $iContentId = $oVersion->getContentVersionId(); | 342 | $iContentId = $oVersion->getContentVersionId(); |
| 320 | $oContentVersion = KTDocumentContentVersion::get($iContentId); | 343 | $oContentVersion = KTDocumentContentVersion::get($iContentId); |
| 321 | - | 344 | + |
| 322 | $sPath = $oContentVersion->getStoragePath(); | 345 | $sPath = $oContentVersion->getStoragePath(); |
| 323 | $sFullPath = sprintf("%s/%s", $sDocumentRoot, $sPath); | 346 | $sFullPath = sprintf("%s/%s", $sDocumentRoot, $sPath); |
| 324 | if (file_exists($sFullPath)) { | 347 | if (file_exists($sFullPath)) { |
plugins/ktcore/folder/addDocument.php
| @@ -5,32 +5,32 @@ | @@ -5,32 +5,32 @@ | ||
| 5 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 8 | - * | 8 | + * |
| 9 | * This program is free software; you can redistribute it and/or modify it under | 9 | * This program is free software; you can redistribute it and/or modify it under |
| 10 | * the terms of the GNU General Public License version 3 as published by the | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 11 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 12 | - * | 12 | + * |
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 16 | * details. | 16 | * details. |
| 17 | - * | 17 | + * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | - * | 20 | + * |
| 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 23 | - * | 23 | + * |
| 24 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 25 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 26 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 27 | - * | 27 | + * |
| 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 29 | * these Appropriate Legal Notices must retain the display of the "Powered by | 29 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 30 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 30 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 32 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 33 | - * copyright notice. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 34 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| @@ -193,14 +193,20 @@ class KTFolderAddDocumentAction extends KTFolderAction { | @@ -193,14 +193,20 @@ class KTFolderAddDocumentAction extends KTFolderAction { | ||
| 193 | $sBasedir = $oKTConfig->get("urls/tmpDirectory"); | 193 | $sBasedir = $oKTConfig->get("urls/tmpDirectory"); |
| 194 | 194 | ||
| 195 | $sFilename = tempnam($sBasedir, 'kt_storecontents'); | 195 | $sFilename = tempnam($sBasedir, 'kt_storecontents'); |
| 196 | - $oContents = new KTFSFileLike($data['file']['tmp_name']); | ||
| 197 | - $oOutputFile = new KTFSFileLike($sFilename); | ||
| 198 | - $res = KTFileLikeUtil::copy_contents($oContents, $oOutputFile); | ||
| 199 | - $data['file']['tmp_name'] = $sFilename; | ||
| 200 | 196 | ||
| 201 | - if (PEAR::isError($res)) { | ||
| 202 | - $oForm->handleError(sprintf(_kt("Failed to store file: %s"), $res->getMessage())); | ||
| 203 | - } | 197 | + //$oContents = new KTFSFileLike($data['file']['tmp_name']); |
| 198 | + //$oOutputFile = new KTFSFileLike($sFilename); | ||
| 199 | + //$res = KTFileLikeUtil::copy_contents($oContents, $oOutputFile); | ||
| 200 | + | ||
| 201 | + //if (PEAR::isError($res)) { | ||
| 202 | + // $oForm->handleError(sprintf(_kt("Failed to store file: %s"), $res->getMessage())); | ||
| 203 | + //} | ||
| 204 | + | ||
| 205 | + | ||
| 206 | + $oStorage =& KTStorageManagerUtil::getSingleton(); | ||
| 207 | + $oStorage->uploadTmpFile($data['file']['tmp_name'], $sFilename); | ||
| 208 | + | ||
| 209 | + $data['file']['tmp_name'] = $sFilename; | ||
| 204 | $_SESSION['_add_data'] = array($key => $data); | 210 | $_SESSION['_add_data'] = array($key => $data); |
| 205 | 211 | ||
| 206 | // if we don't need metadata | 212 | // if we don't need metadata |
| @@ -294,7 +300,7 @@ class KTFolderAddDocumentAction extends KTFolderAction { | @@ -294,7 +300,7 @@ class KTFolderAddDocumentAction extends KTFolderAction { | ||
| 294 | $oUploadChannel->addObserver($mpo); | 300 | $oUploadChannel->addObserver($mpo); |
| 295 | 301 | ||
| 296 | require_once(KT_LIB_DIR . '/storage/storagemanager.inc.php'); | 302 | require_once(KT_LIB_DIR . '/storage/storagemanager.inc.php'); |
| 297 | - require_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); | 303 | + //require_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); |
| 298 | require_once(KT_LIB_DIR . '/documentmanagement/DocumentType.inc'); | 304 | require_once(KT_LIB_DIR . '/documentmanagement/DocumentType.inc'); |
| 299 | require_once(KT_LIB_DIR . '/metadata/fieldset.inc.php'); | 305 | require_once(KT_LIB_DIR . '/metadata/fieldset.inc.php'); |
| 300 | require_once(KT_LIB_DIR . '/documentmanagement/documentutil.inc.php'); | 306 | require_once(KT_LIB_DIR . '/documentmanagement/documentutil.inc.php'); |
| @@ -309,7 +315,8 @@ class KTFolderAddDocumentAction extends KTFolderAction { | @@ -309,7 +315,8 @@ class KTFolderAddDocumentAction extends KTFolderAction { | ||
| 309 | 315 | ||
| 310 | $iFolderId = $this->oFolder->getId(); | 316 | $iFolderId = $this->oFolder->getId(); |
| 311 | $aOptions = array( | 317 | $aOptions = array( |
| 312 | - 'contents' => new KTFSFileLike($aFile['tmp_name']), | 318 | + // 'contents' => new KTFSFileLike($aFile['tmp_name']), |
| 319 | + 'temp_file' => $aFile['tmp_name'], | ||
| 313 | 'documenttype' => DocumentType::get($extra_d['document_type']), | 320 | 'documenttype' => DocumentType::get($extra_d['document_type']), |
| 314 | 'metadata' => $MDPack, | 321 | 'metadata' => $MDPack, |
| 315 | 'description' => $sTitle, | 322 | 'description' => $sTitle, |