Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to copy documents?
#5
First, Thanks very much for help me but I can´t copy documents, I try with this:

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.
Reply


Messages In This Thread
How to copy documents? - by michbukana - 02-09-2012, 04:11 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)