We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

cUurl download size

Accepted answer
10
Views
6
Comments
edited Dec 13, 2018 9:10AM in Customer Portal 6 comments

Content

Hi,

I'm using cURL to get the contents of a file. At 5Mb it seems to break. Anything smaller and it's fine. Any reason why? Here is my code:

function getCSV($location){
$array = Array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$body = \curl_exec($ch);
curl_close($ch);
$Data = str_getcsv($body, ""); //parse the rows 
foreach($Data as &$Row) $Row = str_getcsv($Row, ","); //parse the items in rows
return json_encode($Data);

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!