edrard / phpnextcloud
Nextcloud uploader
v0.0.4
2024-10-01 14:30 UTC
Requires
- php: >=7.0.0
- edrard/function: dev-master
- edrard/mylog: dev-master
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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();