forked from php-opencloud/openstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_large_object.php
More file actions
30 lines (23 loc) · 842 Bytes
/
create_large_object.php
File metadata and controls
30 lines (23 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
require 'vendor/autoload.php';
$openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region' => '{region}',
'user' => [
'id' => '{userId}',
'password' => '{password}',
],
]);
$options = [
];
$service = $openstack->objectStoreV1();
$container = $service->getContainer('{containerName}');
$object = $container->createLargeObject([
'name' => '{objectName}',
'stream' => new \GuzzleHttp\Psr7\Stream(fopen('/path/to/large_object.mov', 'r')),
// optional: specify the size of each segment in bytes
'segmentSize' => 1073741824,
// optional: specify the container where the segments live. This does not necessarily have to be the
// same as the container which holds the manifest file
'segmentContainer' => 'test_segments',
]);