title: Download a file from sharepoint using curl
body: <p>I'm trying to download a file from sharepoint in a Linux environment using curl. I'm using curl NTLM and my request looks like below</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I'm unable to download the file itself the request returns an html response </p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;   
  ...
  &lt;script type="text/javascript"&gt; 
  ... 
  "           &lt;noscript class=""ewa-root-noscript""&gt;" 
  "               Unable to load because JavaScript is disabled.  Enable JavaScript and try again."   
  "           &lt;/noscript&gt;"    
  "           &lt;div id=""ewaContainer"" class=""ewaContainer""&gt;"   
  
  &lt;/html&gt; 
  </code></pre>
  
  <p>What am I doing wrong and is there a better way to get around this</p>