2

I'm trying to upload large files from server to cloud storage (files over 500mb) and I'm getting PHP time outs. I've tried looking at the Google Client Library documentation and I've crawled through stackoverflow, but I can't find anything that could help me. Also is there any way of tracking the progress of the upload?

Here's the code I'm using at the moment:

$options = [
    'resumable' => true,
    'chunkSize' => 524288
];
$uploader = $bucket->getResumableUploader(
    fopen('uploads/' . $name, 'r'),
    $options
);

try {
    $object = $uploader->upload();
} catch (GoogleException $ex) {
    $resumeUri = $uploader->getResumeUri();
    $object = $uploader->resume($resumeUri);
}
Vennufius
  • 23
  • 4
  • Where is your code running? App Engine Standard or Flexible? A Compute Engine VM or on your local machine? – LundinCast Jul 06 '18 at 11:02
  • At the moment I'm running it on my local machine, but I know for a fact that I need to fix this since I can't change my timeout on my server, since the service provider controls that. – Vennufius Jul 06 '18 at 11:10
  • I assume your implementation follows the Google Cloud Client Library. If so, perhaps you should review implementations of sample Cloud Storage Applications [here](https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/storage/).Or you can confirm which method you are using for your implementation - perhaps [Google API Client Libraries](https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries)? – oakinlaja Jul 09 '18 at 17:29
  • @oakinlaja Unfortunately I've tried these as well, with the same result. For the record, my code works up until like 300mb and files above that, I get the timeout error. (I also get the timeout error even though I change my timeout from php.ini to 0, with an error message stating it being 0?). Any ideas what might be causing this, since to my knowledge 0 should be unlimited? – Vennufius Jul 09 '18 at 17:40
  • There is no Google documentation that shows a Quota limit on uploads like this. Can you provide the full details of the timeout error? – oakinlaja Jul 25 '18 at 19:46

0 Answers0