lib/components/dataInterface/connectors/file/SourceFile.php
protected function downloadFile($url, $savePath)
    {
        echo "Download $url...\n";
        $fp = fopen($savePath, 'w');
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_FILE, $fp);
        //curl_setopt($ch, CURLOPT_HEADER, 1);
        $data = curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        fclose($fp);
        if ($httpCode !== 200) {
            @unlink($savePath);

            return false;
        }

        if (!file_exists($savePath) || !filesize($savePath) === 0) {
            @unlink($savePath);

            return false;
        }

        return $savePath;
    }
protected function downloadFile($url, $savePath)
    {
        echo "Download $url...\n";
        $fp = fopen($savePath, 'w');
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_FILE, $fp);
        //curl_setopt($ch, CURLOPT_HEADER, 1);
        $data = curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        fclose($fp);
        if ($httpCode !== 200) {
            @unlink($savePath);

            return false;
        }

        if (!file_exists($savePath) || !filesize($savePath) === 0) {
            @unlink($savePath);

            return false;
        }

        return $savePath;
    }
[[@doctodo method_description:downloadFile]].

@param [[@doctodo param_type:url]]      $url      [[@doctodo param_description:url]]
@param [[@doctodo param_type:savePath]] $savePath [[@doctodo param_description:savePath]]

@return [[@doctodo return_type:downloadFile]] [[@doctodo return_description:downloadFile]]