{"action":"created","issue":{"url":"https://api.github.com/repos/CPIGroup/phpAmazonMWS/issues/66","repository_url":"https://api.github.com/repos/CPIGroup/phpAmazonMWS","labels_url":"https://api.github.com/repos/CPIGroup/phpAmazonMWS/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/CPIGroup/phpAmazonMWS/issues/66/comments","events_url":"https://api.github.com/repos/CPIGroup/phpAmazonMWS/issues/66/events","html_url":"https://github.com/CPIGroup/phpAmazonMWS/issues/66","id":138141256,"number":66,"title":"Unable to Download MWS Report more than 2mb","user":{"login":"walkout","id":3089556,"avatar_url":"https://avatars.githubusercontent.com/u/3089556?v=3","gravatar_id":"","url":"https://api.github.com/users/walkout","html_url":"https://github.com/walkout","followers_url":"https://api.github.com/users/walkout/followers","following_url":"https://api.github.com/users/walkout/following{/other_user}","gists_url":"https://api.github.com/users/walkout/gists{/gist_id}","starred_url":"https://api.github.com/users/walkout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walkout/subscriptions","organizations_url":"https://api.github.com/users/walkout/orgs","repos_url":"https://api.github.com/users/walkout/repos","events_url":"https://api.github.com/users/walkout/events{/privacy}","received_events_url":"https://api.github.com/users/walkout/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-03T10:39:56Z","updated_at":"2016-06-06T14:21:34Z","closed_at":"2016-05-26T13:53:38Z","body":"Hi ,\r\nSo After spending 3-4 days of checking , I still can't figure out why i am not able to download report more than 2mb.\r\n\r\nThis is what i have made modifications to the code , Would appreciate if you could point me in the right direction or why this is happening.\r\n\r\n\r\nMy curl request modified - i was trying various options but they dont seem to work.\r\n\r\n```php\r\nfunction fetchURL ($url, $param) {\r\n\t\t   \r\n\t\tset_time_limit(0);\r\n        $return = array();\r\n\t\t\r\n\t\t//$fp1 = fopen('request.txt','w+');\r\n\t\t//require_once 'MyStream.php';\r\n\t\t//stream_wrapper_register(\"test\", \"MyStream\") or die(\"Failed to register protocol\");\r\n\t\t//$fp = fopen(\"test://MyTestVariableInMemory\", \"r+\");\r\n\t\t$filepath = 'request2.txt';\r\n        $ch = curl_init();     \r\n\t\tcurl_setopt($ch,CURLOPT_URL,$url);\t\r\n\t\t//curl_setopt($ch, CURLOPT_RANGE, 2000-5000);\r\n\t\r\n\t\tcurl_setopt($ch,CURLOPT_HEADER, false);\t\r\n\t\tcurl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this,'read_header' ));\r\n\t\t//curl_setopt($ch, CURLOPT_BUFFERSIZE, 256);\r\n        curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\t\t\r\n        curl_setopt($ch,CURLOPT_TIMEOUT, 0);\r\n        //curl_setopt($ch,CURLOPT_FORBID_REUSE, 0);\r\n       // curl_setopt($ch,CURLOPT_FRESH_CONNECT, 0);  \r\n\t\t//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n\t\t\r\n        if (!empty($param)){\r\n            if (!empty($param['Header'])){\r\n                curl_setopt($ch,CURLOPT_HTTPHEADER, $param['Header']);\r\n            }\r\n            if (!empty($param['Post'])){\r\n                curl_setopt($ch,CURLOPT_POSTFIELDS, $param['Post']);\r\n            }\r\n        }\r\n\t\t//curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, array($this,'progresscurl'));\r\n\t\tcurl_setopt($ch, CURLOPT_WRITEFUNCTION, array($this,'writecurl'));\t\r\n\t\t//curl_setopt($ch, CURLOPT_FILE, $fp); \r\n\t\t//curl_setopt($ch, CURLOPT_VERBOSE, true);\r\n\t\t//curl_setopt($ch, CURLOPT_STDERR, $fp1);\r\n\t\t\t\r\n        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n        $data = curl_exec($ch);\r\n\t\t//echo $data;\r\n\t\t$info = curl_getinfo($ch);\r\n\t\tvar_dump($data);\r\n\t\tvar_dump($info);\t\t\r\n\t\t\r\n        if ( curl_errno($ch) ) {\r\n                $return['ok'] = -1;\r\n                $return['error'] = curl_error($ch);\r\n                return $return;\r\n        }\r\n        \r\n        if (is_numeric(strpos($data, 'HTTP/1.1 100 Continue'))) {\r\n            $data=str_replace('HTTP/1.1 100 Continue', '', $data);\r\n        }\r\n        $data = preg_split(\"/\\r\\n\\r\\n/\",$data, 2, PREG_SPLIT_NO_EMPTY);\r\n        if (!empty($data)) {\r\n                $return['head'] = ( isset($data[0]) ? $data[0] : null );\r\n                $return['body'] = ( isset($data[1]) ? $data[1] : null );\r\n        } else {\r\n                $return['head'] = null;\r\n                $return['body'] = null;\r\n        }\r\n        \r\n        $matches = array();\r\n        $data = preg_match(\"/HTTP\\/[0-9.]+ ([0-9]+) (.+)\\r\\n/\",$return['head'], $matches);\r\n        if (!empty($matches)) {\r\n                $return['code'] = $matches[1];\r\n                $return['answer'] = $matches[2];\r\n        }\r\n        \r\n        $data = preg_match(\"/meta http-equiv=.refresh. +content=.[0-9]*;url=([^'\\\"]*)/i\",$return['body'], $matches);\r\n        if (!empty($matches)) {\r\n                $return['location'] = $matches[1];\r\n                $return['code'] = '301';\r\n        }\r\n        \r\n        if ( $return['code'] == '200' || $return['code'] == '302' ) {\r\n                $return['ok'] = 1;\r\n        } else {\r\n                $return['error'] = (($return['answer'] and $return['answer'] != 'OK') ? $return['answer'] : 'Something wrong!');\r\n                $return['ok'] = 0;\r\n        }\r\n        \r\n        foreach (preg_split('/\\n/', $return['head'], -1, PREG_SPLIT_NO_EMPTY) as $value) {\r\n                $data = preg_split('/:/', $value, 2, PREG_SPLIT_NO_EMPTY);\r\n                if (is_array($data) and isset($data['1'])) {\r\n                        $return['headarray'][$data['0']] = trim($data['1']);\r\n                }\r\n        }\r\n        \r\n        curl_close($ch);\r\n\t\t//fclose($fp);\r\n\t\t\r\n        \r\n        return $return;\r\n       }\r\n```\r\n\r\n\r\n```php\r\n\tpublic function processLine($line){\r\n\t\t\r\n\t\tfile_put_contents('request2.txt', $line, FILE_APPEND);\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\tpublic function writecurl($ch,$data){\r\n\t\t\r\n\t\t//fclose($fp);\r\n\t\t\r\n\t\t$this->currentLine .= $data;\r\n        $lines = explode(\"\\n\", $this->currentLine);\r\n        // The last line could be unfinished. We should not\r\n        // proccess it yet.\r\n        $numLines = count($lines) - 1;\r\n        $this->currentLine = $lines[$numLines]; // Save for the next callback.\r\n\r\n        for ($i = 0; $i < $numLines; ++$i) {\r\n            $this->processLine($lines[$i]); // Do whatever you want\r\n            ++$this->totalLineCount; // Statistics.\r\n            $this->totalLength += strlen($lines[$i]) + 1;\r\n        }\r\n\t\t\r\n\t\t\r\n        return strlen($data); // Ask curl for more data (!= value will stop).\r\n\t\t\r\n\t\t\r\n\t\t//$len = strlen($data);\r\n\t\t\r\n\t\t//return $len;\t\t\t\r\n\t\t//return null;\r\n\t}\r\n```\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/CPIGroup/phpAmazonMWS/issues/comments/223973442","html_url":"https://github.com/CPIGroup/phpAmazonMWS/issues/66#issuecomment-223973442","issue_url":"https://api.github.com/repos/CPIGroup/phpAmazonMWS/issues/66","id":223973442,"user":{"login":"walkout","id":3089556,"avatar_url":"https://avatars.githubusercontent.com/u/3089556?v=3","gravatar_id":"","url":"https://api.github.com/users/walkout","html_url":"https://github.com/walkout","followers_url":"https://api.github.com/users/walkout/followers","following_url":"https://api.github.com/users/walkout/following{/other_user}","gists_url":"https://api.github.com/users/walkout/gists{/gist_id}","starred_url":"https://api.github.com/users/walkout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walkout/subscriptions","organizations_url":"https://api.github.com/users/walkout/orgs","repos_url":"https://api.github.com/users/walkout/repos","events_url":"https://api.github.com/users/walkout/events{/privacy}","received_events_url":"https://api.github.com/users/walkout/received_events","type":"User","site_admin":false},"created_at":"2016-06-06T14:21:34Z","updated_at":"2016-06-06T14:21:34Z","body":"Hi ,I tried the application , But it is still not downloading the full file.\nCan you look into it as paid support?\nRitesh\n\nDate: Thu, 26 May 2016 06:53:39 -0700\nFrom: notifications@github.com\nTo: phpAmazonMWS@noreply.github.com\nCC: ritesh_khare@live.in; author@noreply.github.com\nSubject: Re: [CPIGroup/phpAmazonMWS] Unable to Download MWS Report more than 2mb (#66)\n\nClosed #66.\n\n\n—\nYou are receiving this because you authored the thread.\nReply to this email directly or view it on GitHub\n\n\n  \n  \n\n\n \t\t \t   \t\t  "}}
{"actor":{"display_login":"walkout"}}