【发布时间】:2018-05-08 17:57:07
【问题描述】:
我正在尝试将文件从 Google 云端硬盘链接从 Google 服务器下载到我的网络服务器,以避免 PHP POST 中的最大大小为 100。
<?php
$link = $_POST["linkToUpload"];
$upload = file_put_contents("uploads/test".rand().".txt", fopen($link, 'r'));
header("Location: index.php");
?>
插入像http://example.com/text.txt 这样的普通链接可以正常工作。问题来自链接谷歌驱动器https://drive.google.com/uc?authuser=0&id=000&export=download。这是来自 Google Drive 的直接链接,但它不起作用。所以我尝试插入我获得的在本地下载文件的链接https://doc-08-bo-docs.googleusercontent.com/docs/securesc/000/000/000/000/000/000?e=download,但它仍然无法正常工作。你认为谷歌试图避免服务器到服务器的复制吗?还是有其他方法可以做到?
【问题讨论】:
标签: php html google-drive-api