google app engine - PHP fails fopen if the file is large -
i'm running app on google app engine, on php.
i'm using following code download file api:
$context = [ "http" => [ "method" => "get", "header" => "authorization: ".$token."\r\n", "follow_location"=>1, "timeout"=>600, "ignore_errors"=>1 ] ]; $context = stream_context_create($context); $sourcefile = fopen($location,"r", false,$context) or die("no handle");
this code followed chunk read , write resource (basically i'm storing file on google storage).
$destinationfile = fopen($filename,"w"); while ($buffer = fread($sourcefile, 1048576)) { fwrite($destinationfile,$buffer); }
the issue code work if file small (circa below 30 mb) fopen fails if file large. have "no handle" message.
it's kinda weird because explictly avoided use file_get_contents download entire file in memory , don't understand why fopen should fail!
can me? thanks
the limit 32 megabytes. why fails. limit not, apparently, apply locally, hence why works on dev server.
https://cloud.google.com/appengine/docs/python/urlfetch/#python_quotas_and_limits
Comments
Post a Comment