Hello everybody
I have a problem with my use of OCS API.
I try to create a new share with my php application. Everything seems to work fine if I try to share a folder but when I try with zip file I've an error 400 with the message "please specify a file or folder path"
see bellow a piece of my code
$post_data = "shareType=3&path=$this->CUSTOMER/$this->CAMPAIGN_NAME";
$ch = curl_init();
$url = "https://owncloud-solutions.cacom.fr/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares";
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERPWD, 'login:mdp');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
foreach(array_unique($this->zips) as $zip) {
curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data);
$output = curl_exec ($ch); // execute
}
curl_close ($ch);
It works! but if I try with that
$post_data = "shareType=3&path=$this->CUSTOMER/$this->CAMPAIGN_NAME/$this->_MYFILE";
where the file is zip as "TRC-VL-1994-2016_Decembre_CADEAUX-010.zip" it doesn't work!
I try since 2 days and I'm totaly lost