I've read that if Guzzle cannot determine Content-Length, it will send Transfer-Encoding: Chunked headers and cURL on the back-end will handling the chunking. But I'm obviously hitting post_max_size limit. ("POST Content-Length of 524288375 bytes exceeds the limit of 8388608 bytes) when POSTing to a working uploadChunkerController. I know the upload handler (endpoint) works with smaller files. I feel I have something configured wrong with my Guzzle options. I have to set verify
to false
and I need to post an api_key
with the request.
$client = new Client();
$fh = fopen('../storage/random-500M.pdf', 'r');
$url = 'https://local:8443/app_dev.php/_uploader/bigupload/upload';
$request = $client->request(
'POST',
$url,
[
'verify' => false,
'multipart' => [
[
'name' => 'api_key',
'contents' => 'abc123'
],
[
'name' => 'file',
'contents' => $fh,
'filename' => 'bigupload.pdf'
]
]
]
);
Editing php.ini settings is not an option nor the solution. I've found a lot of 'solutions' that appear to be for older versions of Guzzle. Am I thinking too hard about this? Is there a simpler solution?
8MB
, if you have access to that server/script which it appears you do you will need to change the limit. – Spay