edrard / phpnextcloud
Nextcloud uploader
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.0.0
- edrard/function: dev-master
- edrard/mylog: dev-master
README
Simple Php Nextcloud uploader
Attention!!! Package using shell curl to upload files, becouse sometime php curl have problems to upload big files.
$config = array(
'url' => 'https://nextcloud/',
'login' => 'login',
'password' => 'password',
'httpheader' => array('OCS-APIRequest: true')
);
# Uploading file
$uploader = new Uploader($config);
# In fucntion $uploader->uploadFile if third parametr is False, then its not using shell Curl
if($uploader->uploadFile('1500mb.bin','/path/inside/nc')){
#Share File for public
$sharing = new Sharing($config);
$respons = $sharing->share('1500mb.bin','/path/inside/nc');
}
# Delete file
$delete = new Delete($config);
$delete->delete('64mb.bin');
# List folder
$info = new Info($config);
$list = $info->getFolderList();