Hi
Just wondering if it's possible to set author when uploading a new document via WS. According to the php sample on wiki There's a way to set the author, but when I execute the script it returns the uploader as author. Idea behind this is to use a system uploader account that would only set the name of Author, permissions and everything else that comes along with the file upload can stay as they are, as this would only be used for keeping track of user activity.
OKM version: 6.2.1
Php sample that I used:
(I set the author as)
Just wondering if it's possible to set author when uploading a new document via WS. According to the php sample on wiki There's a way to set the author, but when I execute the script it returns the uploader as author. Idea behind this is to use a system uploader account that would only set the name of Author, permissions and everything else that comes along with the file upload can stay as they are, as this would only be used for keeping track of user activity.
OKM version: 6.2.1
Php sample that I used:
(I set the author as)
Code: Select all
'author' => 'username_that_I_send_as_string'
Code: Select all
<?php
// Register WSDL
$OKMAuth = new SoapClient('http://localhost:8080/OpenKM/services/OKMAuth?wsdl');
$OKMDocument = new SoapClient('http://localhost:8080/OpenKM/services/OKMDocument?wsdl');
$file = '/etc/hosts';
// Login
$loginResp = $OKMAuth->login(array('user' => 'okmAdmin', 'password' => 'admin'));
$token = $loginResp->return;
echo "Token: ".$token."<br>";
// Create document
$doc = array('path' => '/okm:root/hosts.txt', 'mimeType' => null,
'actualVersion' => null, 'author' => null, 'checkedOut' => false,
'created' => null, 'keywords' => 'nada', 'language' => null,
'lastModified' => null, 'lockInfo' => null, 'locked' => false,
'permissions' => 0, 'size' => 0, 'subscribed' => false, 'uuid' => null,
'convertibleToPdf' => false, 'convertibleToSwf' => false,
'compactable' => false, 'training' => false, 'convertibleToDxf' => false);
$createResp = $OKMDocument->create(array('token' => $token, 'doc' => $doc, 'content' => file_get_contents($file)));
$newDoc = $createResp->return;
echo "[DOCUMENT] Path: ".$newDoc->path.", Author: ".$newDoc->author.", Size: ".$newDoc->actualVersion->size."<br>";
// Logout
$OKMAuth->logout(array('token' => $token));
?>