MDL-42666 repository_boxnet: Downloading a file follows locations

This commit is contained in:
Frederic Massart
2013-11-06 12:46:17 +08:00
parent d4617dcbae
commit 05c9a3da2a
+2 -1
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);
}