MDL-42666 repository_boxnet: Downloading a file follows locations

This commit is contained in:
Frederic Massart 2013-11-06 12:42:22 +08:00
parent 102a241998
commit 51ada519a6

View file

@ -58,7 +58,8 @@ class boxnet_client extends oauth2_client {
* @return bool Success or not.
*/
public function download_file($fileid, $path) {
$result = $this->download_one($this->make_url("/files/$fileid/content"), array(), array('filepath' => $path));
$result = $this->download_one($this->make_url("/files/$fileid/content"), array(),
array('filepath' => $path, 'CURLOPT_FOLLOWLOCATION' => true));
return ($result === true && $this->info['http_code'] === 200);
}