Hello,
just for the ones who still follow the orginal question. A friend of mine was able to help me out and put together a -really- simple php script that does the upload job. I want to share it with you:
just for the ones who still follow the orginal question. A friend of mine was able to help me out and put together a -really- simple php script that does the upload job. I want to share it with you:
Code: Select all
It has no error handling but works ok. Embedded in a cron job it should do.<?php
$okmurl="http://localhost:8080/OpenKM/";
$okmid="username";
$okmpw="password";
$impfile = $argv[1];
$OKMAuth = new SoapClient($okmurl."OKMAuth?wsdl");
$OKMDocument = new SoapClient($okmurl."OKMDocument?wsdl");
// open file and encode if necessary
$handle = fopen($impfile,'rb');
$file_content = fread($handle,filesize($impfile));
fclose($handle);
$encoded = base64_encode($file_content);
// Login
$token = $OKMAuth->login($okmid, $okmpw);
$OKMDocument->createSimple($token,"/okm:root/file.to.upload",$file_content);
// Logout
$OKMAuth->logout($token);
?>