如果你想使用谷歌照片,你应该使用
Google Photos APIs upload media
.
注:
通过API上传到Google照片的所有媒体项都以完全分辨率存储在
original quality
. 如果你的上传超过每个用户25MB,你的应用程序应该提醒用户,这些上传将计入他们谷歌账户的存储空间。
字节通过上传请求上传到Google。如果上载请求成功,则返回原始文本字符串形式的上载令牌。要创建媒体项,请在
batchCreate
// Create a new upload request
// Specify the filename that will be shown to the user in Google Photos
// and the path to the file that will be uploaded
// When specifying a filename, include the file extension
try {
$uploadToken = $photosLibraryClient->upload(file_get_contents($localFilePath), $filename);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
// Handle error
}