获取上载到Sharepoint的文件的URL [英] Getting the URL of a file uploaded to Sharepoint
问题描述
我使用PHP将文件上传到Sharepoint。文件已成功上传,但我无法提取文档的URL。
I am using PHP to upload a file to Sharepoint. The file is successfully uploading, but I am unable to extract the URL for the document.
要上传的代码是
The code to upload is
$handle = fopen($_FILES["file"]["tmp_name"], 'r+');
$stream = new GuzzleHttp\Psr7\Stream($handle);
$body = GuzzleHttp\Psr7\stream_for($stream->getContents());
$token = $_SESSION['access_token'];
$graph = new Graph();
$graph->setAccessToken($token);
$request = $graph->createRequest("put", '/me/drive/root:/' . $orgFileName . ':/content');
$request->attachBody($body);
$response = $request->execute();
echo 'Status: ' . $response->getStatus();
echo '<br>';
var_dump($response);
$url = $response->getProperties()['webUrl'];
echo "URL = " . $url;
是否有从响应中提取URL的方法?
Is there a method to extract the URL from the response ?
推荐答案
我可以看到您的问题与sharepoint有关。
I can see that your issue is related with sharepoint.
此论坛仅处理有关App for Office的问题。
this forum only handles the issue regarding App for Office.
因此,为了更好地响应您的问题,我将此线程移至
为
SharePoint 2013论坛开发应用程序。
so for better response and better solution for your issue, I move this thread to
Developing Apps for
SharePoint 2013 Forum.
我们推荐p的原因正确地说,您将获得最合格的受访者群体,而定期阅读论坛的其他合作伙伴可以分享他们的知识或从您与我们的互动中学习。
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
感谢您的理解。
问候
Deepak
Deepak
这篇关于获取上载到Sharepoint的文件的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!