如何在不下载的情况下输出链接请求?我已经使用htmlentities
继续下载它不想直接输出链接而不下载。
秘密Json文件
http://s000.tinyupload.com/index.php?file_id=86058541986944274128
这个api fileId
https://developers.google.com/drive/v3/reference/files/get我在try live中测试它在json中显示任何信息。但如何申请到PHP。或另外一种方式。
<?php
require_once('vendor/autoload.php');
putenv('GOOGLE_APPLICATION_CREDENTIALS=test.json');
$client = new Google_Client();
$client->addScope(Google_Service_Drive::DRIVE);
$client->useApplicationDefaultCredentials();
$service = new Google_Service_Drive($client);
$fileId = "1wn9lQWIipzLYqyuJMzwwUTh3XUSpuokP";
$content = $service->files->get($fileId, array("alt" => "media"));
header("Content-Disposition: attachment; filename=test.png");
header('Content-Type: image/png');
echo htmlentites($content->getBody()->getContents());
?>