edrard / phpnextcloud
Nextcloud 上传器
v0.0.4
2024-10-01 14:30 UTC
Requires
- php: >=7.0.0
- edrard/function: dev-master
- edrard/mylog: dev-master
README
简单的 Php Nextcloud 上传器
注意!!!该包使用 shell curl 来上传文件,因为有时 php curl 在上传大文件时可能存在问题。
$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();