Client error response [status code] 413 [reason phrase] Request Entity Too Large [url]
I am trying to upload a file to OpenStack's container.
I can upload small files to the container successfully but not able to upload large files like 1 MB or larger than 1 MB.
I am getting this error.
Client error response [status code] 413 [reason phrase] Request Entity Too Large [url]
Here is my code snippet
<?php
require 'vendor/autoload.php';
use OpenCloud\OpenStack;
use OpenCloud\ObjectStore\Resource\DataObject;
global $client;
$client = new OpenStack('http://192.168.171.131:35357/v2.0/', array(
'username' => 'admin',
'password' => 'devstack',
'tenantName' => 'admin'
));
$objectStoreService = $client->objectStoreService('swift', 'RegionOne', 'publicURL');
$container = $objectStoreService->getContainer('mani@ymail.com');
// Upload large object to the container.
$options = array(
'name' => 'test.doc',
'path' => 'uploads/test.doc'
);
$objectTransfer = $container->setupObjectTransfer($options);
$objectTransfer->upload();
If I replace 'path' => 'uploads/test.doc'
with 'path' => getenv('uploads/test.doc')
I get You must provide either a readable path or a body
.
I can easily upload the large files to my Server using PHP.
I can upload large files directly into container from OpenStack's Horizon Dashboard
Is your problem through CLI or your code and not in OpenStack's Horizon Dashboard. If your able to do it using OpenStack's Horizon Dashboard then check your code. If not, can you explain the issue in detail?
Dear I can upload small files via my PHPOpenCloud code ... but I cannot upload 1MB > files
Hmm... Out of interest, what's the exact file size of
uploads/test.doc
? Could you https://github.com/rackspace/php-opencloud/blob/master/docs/userguide/Debugging.md#strategy-2-wire-logging (turn on HTTP logging) and send the output to jamie.hannaford @ http://rackspace.com