02-12-2012, 03:12 PM
(This post was last modified: 02-12-2012, 04:06 PM by michbukana.)
First, Thanks very much for help me but I can´t copy documents, I try with this:
I think that this source is wrong, I need a string with the path but I do anything wrong when I get the document´s properties.
I try to test addDocument and documents add to the new copy folder but the path is incorrect, the problem is the $_tmpFile I don´t know how to get the value correctly.
PHP Code:
// Get document to copy properties
$latestContent = $document->getLatestContent();
$_fileName = $document->getName();
$_fileType = $latestContent->getFileType();
$_mimeType = $latestContent->getMimeType();
$_originalName = $latestContent->getOriginalFileName();
$_sequence = $document->getSequence();
$_reqversion = $latestContent->getVersion();
$_tmpFile = $latestContent->getPath(); // I don't know how to get the tmpFile ????
$_user = $latestContent->getUser();
// Copy only photos (jpg,gif,png)
if($_fileType == ".jpg" || $_fileType == ".gif" || $_fileType == '.png'){
$res = $dest->addDocument($_fileName, '', 0, $_user, '', $_tmpFile, $_originalName, $_fileType, $_mimeType, $_sequence, $reviewers=array(), $approvers=array(), $_reqversion, $version_comment='');
}
I think that this source is wrong, I need a string with the path but I do anything wrong when I get the document´s properties.
PHP Code:
$_tmpFile = $latestContent->getPath();
I try to test addDocument and documents add to the new copy folder but the path is incorrect, the problem is the $_tmpFile I don´t know how to get the value correctly.