include '../xmlapi.php';
$ip = 'www.example.com';
$root_pass = 'abc';
$domain = "www.example.com";
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("abc",$root_pass);
$xmlapi->set_http_client('curl');
$xmlapi->set_output('json');
$xmlapi->set_port(2083);
$xmlapi->set_debug(1);
print $xmlapi->api2_query("user",'Fileman','uploadfiles',array('file-'=>'file1-public_html/subdomainuser/abc/sample.txt'));
This code works correctly when I use to create a subdomain or create a directory via mkdir cpanel api 2. But when used to upload files, it always shows the same answer
{"cpanelresult":{"apiversion":2,"error":"You must specify at least one file to upload.","func":"uploadfiles","data":[{"uploads":[],"succeeded":0,"warned":0,"failed":0}],"event":{"result":1},"module":"Fileman"}}
Can someone help me complete the boot process via cpanel xml-api?
source
share