Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用curl从sharepoint下载文件_Curl_Sharepoint - Fatal编程技术网

使用curl从sharepoint下载文件

使用curl从sharepoint下载文件,curl,sharepoint,Curl,Sharepoint,我正在尝试使用curl在Linux环境中从sharepoint下载一个文件。我正在使用curl NTLM,我的请求如下所示 curl -vvv "http://sitename/sites/site1/_layouts/15/xlviewer.aspx?id=/sites/cloud/Shared%20Documents/Export_9_26.xlsx" --ntlm --user "username":"pass" -o download.csv 我无法下载文件本身请求返回html响应 &

我正在尝试使用curl在Linux环境中从sharepoint下载一个文件。我正在使用curl NTLM,我的请求如下所示

curl -vvv "http://sitename/sites/site1/_layouts/15/xlviewer.aspx?id=/sites/cloud/Shared%20Documents/Export_9_26.xlsx" --ntlm --user "username":"pass" -o download.csv
我无法下载文件本身请求返回html响应

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   
...
<script type="text/javascript"> 
... 
"           <noscript class=""ewa-root-noscript"">" 
"               Unable to load because JavaScript is disabled.  Enable JavaScript and try again."   
"           </noscript>"    
"           <div id=""ewaContainer"" class=""ewaContainer"">"   

</html> 

...
... 
"           " 
“无法加载,因为禁用了JavaScript。请启用JavaScript,然后重试。”
"           "    
"           "   

我做错了什么?有没有更好的方法来解决这个问题?
sites/site1/\u layouts/15/xlviewer.aspx
URL是在线Excel查看器,即它表示网页,而不是文件。表示文件的正确URL如下所示:

sites/site1/Shared%20Documents/Export_9_26.xlsx

其中
共享的%20个文档
表示文档库,其余的是路径和文件名。

谢谢-这解释了响应