I'm trying to upload a file to a DigitalOcean Object Storage "Spaces" in Laravel 5.5 (which use the same driver as Amazon s3 and the following package; "league/flysystem-aws-s3-v3 ~1.0") using the Storage Facade by simply doing:
$do_spaces = Storage::disk('spaces');
$this->comment('Uploading to DO Spaces...');
$do_spaces->put($remotepath, file_get_contents($fullpath));
File size is about 185mb and I'm getting the following error:
An exception occurred while uploading parts to a multipart upload. The following parts had errors:
- Part 2: Error executing "UploadPart" on "https://BUCKET.ams3.digitaloceanspaces.com/FILEPATH?partNumber=2&uploadId=2~zkVfkAFU2g4GTY8s4JpV53-jXQ7fJSU"; AWS HTTP error: Server error: `PUT https://BUCKET.ams3.digitaloceanspaces.com/FILEPATH?partNumber=2&uploadId=2~zkVfkAFU2g4GTY8s4JpV53-jXQ7fJSU` resulted in a `503 Slow Down` response:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>SlowDown</Code>
<Message>Please reduce your request rate.</Message> (truncated...)
SlowDown (server): Please reduce your request rate. - <?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>SlowDown</Code>
<Message>Please reduce your request rate.</Message>
<RequestId></RequestId>
</Error>
This doesn't happen all the times, actually, most of the times it works but:
As I can read from S3 documentation you can upload a file in a single operation (max size 5GB), but I did not found any documentation on how to do it
Assuming I would keep going with multipart-upload, how can I configure a specific request rate?