Client error response [status code] 413 [reason phrase] Request Entity Too Large [url]

asked 2014-07-13 12:55:01 -0600

mani619cash gravatar image

updated 2014-07-13 16:45:21 -0600

smaffulli gravatar image

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


require 'vendor/autoload.php';

use OpenCloud\OpenStack;
use OpenCloud\ObjectStore\Resource\DataObject;

global $client;

$client = new OpenStack('', array(
    'username' => 'admin',
    'password' => 'devstack',
    'tenantName' => 'admin'

$objectStoreService = $client->objectStoreService('swift', 'RegionOne', 'publicURL');

$container = $objectStoreService->getContainer('');
// Upload large object to the container.
$options = array(
    'name' => 'test.doc',
    'path' => 'uploads/test.doc'
$objectTransfer = $container->setupObjectTransfer($options);

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

edit retag flag offensive close merge delete


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?

SGPJ gravatar imageSGPJ ( 2014-07-13 12:59:02 -0600 )edit

Dear I can upload small files via my PHPOpenCloud code ... but I cannot upload 1MB > files

mani619cash gravatar imagemani619cash ( 2014-07-13 22:13:10 -0600 )edit

Hmm... Out of interest, what's the exact file size of uploads/test.doc? Could you (turn on HTTP logging) and send the output to jamie.hannaford @

jamiehannaford gravatar imagejamiehannaford ( 2014-07-15 14:27:17 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-07-14 11:38:40 -0600

smaffulli gravatar image

I'll throw it out there: did you check your php.ini to make sure upload_max_filesize and post_max_size are over 1Mb?

edit flag offensive delete link more


Yes, obviously they are 18MB ... Thats why I can upload files to my web server but not to server TO container (using code) ...

mani619cash gravatar imagemani619cash ( 2014-07-14 11:43:06 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-07-13 12:55:01 -0600

Seen: 2,110 times

Last updated: Jul 14 '14