[英]How to convert CURLOPT_FILE for Google AppEngine?
由于不允许在Google AppEngine上进行CURL和文件编写,因此我需要帮助来转换以下CURL请求,以便可以在其上运行该请求:
$ch = curl_init("http://example.com/external.php");
$fp = fopen("internal.php", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
header("Location:internal.php");
您需要将文件写入Google云端存储。 所以像
$in = "http://example.com/external.php";
$out = "gs://bucket/internal.php";
file_put_contents($out, file_get_contents($in));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.