简体   繁体   中英

Upload file from Google Drive to S3 Server using php

I want to upload file from google drive to S3 server. I used Google Picker to select file from google drive. Unfortunately, I have difficulty to upload file to s3 after select file.

I used file_get_contents(file_url) and then upload to s3 server. It working fine in dropbox api. But I can't get content form google drive returned url.

Could you please share me the idea and suggestions?

try this S3 Class: s3 class

<?php
require( "s3.class.php" );
$contents = file_get_contents(file_url);
$s3svc = new S3();
$s3svc->putBucket('bucketName');
$objs = $s3svc->getObjects('bucketName');
$out = $s3svc->putObject( $filename, $contents, 'bucketName',$permissions, $fileType );
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM