我终于解决了。很抱歉发布解决方案。下面是我创建的将文件上传到服务器的函数:
require('functions/egnyte/lib/curl.php');
require('functions/egnyte/lib/curl_response.php');
require('functions/egnyte/EgnyteClient.php');
function doUpload() {
$domain = 'yourdomain';
$folder = '/Shared/our folder name/';
$oauthToken = 'your oauth token';
$fileBinaryContents = file_get_contents($_FILES['filedata']['tmp_name']);
$fileName = $_FILES['filedata']['name'];
// instantiate an Egnyte Client with the domain and oAuth token for the user with which the upload will be performed
$egnyte = new EgnyteClient($domain, $oauthToken);
// perform the upload and get the response from the server
$response = $egnyte->uploadFile($folder, $fileName, $fileBinaryContents);
}
如果有人遇到任何问题/问题,请务必告诉我。我可以帮忙。
供参考:
您也可以联系:
- 如何获取 oauth 令牌。
- 在您的网站页面上列出您的 egnyte 帐户的文件夹。