Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderators: ArturoRobles, ArturoRobles

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By matteo2098
#828025
hi,

i found this code for OUTPUT DOCUMENTf saved in remote server and i need the same thing for INPUT DOCUMENT:

$caseUID = @@APPLICATION;
$docUID = 'UID OUTPUT DOCUMENT'; //set to the Output Document's unique ID
if(@@Approvazione==1){
PMFGenerateOutputDocument($docUID);
//find the generated Output Document in the wf_<WORKSPACE>.APP_DOCUMENT table
$query = "SELECT MAX(DOC_VERSION) AS MAX_VERSION, APP_DOC_UID FROM APP_DOCUMENT
WHERE APP_UID = '$caseUID' AND DOC_UID='$docUID'";
$result = executeQuery($query);
if (is_array($result) and count($result) > 0) {
$g = new G();
$docPath = PATH_DOCUMENT . $g->getPathFromUID(@@APPLICATION) . PATH_SEP . 'outdocs'. PATH_SEP. $docUID.'.pdf';
$filename = $result[1]['APP_DOC_UID'] . '_' . $result[1]['MAX_VERSION'];
}
//copy to a remote server:
$remoteDir = '/opt/test'; //set to directory path on remote server
$conn = ssh2_connect('ip', 22); //set to URL for remote server
ssh2_auth_password($conn, 'user', 'password'); //set the username and password
ssh2_scp_send($conn, "$docPath$filename.doc", "$remoteDir$filename.doc");
ssh2_scp_send($conn, "$docPath$filename.pdf", "$remoteDir$filename.pdf");
}
could i have a code for INPUT DOCUMENT please??

thanks

The 500 Internal Server Error is the general catch[…]

Really very nice blog information for this one and[…]

This is a long, lengthy and cumbersome process. T[…]

Great read for when on the road. The book provides[…]