cb.files.upload

param value example
pid parent object Id. 20
localFile the absolute location of a file on the same server /var/www/website.com/book.pdf
tmplId Template id of the file to be added (in CaseBox each tree object has a template) 19
tmplData ? file metadata according to the template {'language': 'english', 'price': '$10'}
date ? the date in mysql format 2012-03-27 10:25
ownerId the userId of the owner 9
filename ? the title that will replace the original filename of the uploaded file new-book.pdf
file multipart/form-data

Example Response

When an upload is successful, the following xml is returned:

<objectId>28</objectId>

Class usage

$param = array(
    'pid' => 9
    ,'title' => 'my-renamed-file.pdf'
    ,'localFile' => '/var/www/test.pdf'
    ,'ownerId' => 1
    ,'tmplId' => 7
    ,'date' => "2014-02-11T00:00:00Z"
    ,'fileExistAction' => 'replace'
);
$f = new \CB\Api\Files();
$f->upload($param);


// ??? $newId will contain the Id of the newly created object