I have the issue that I can't seem to find out how to send large files via HTTP stream from a native PHP client to a CakePHP controller.
I thought about setting up an HTTP streaming plain PHP client, but this resulted only in 500 internal errors.
In this case, the controller I want to send the file to is called Users and the method (action) is called inbound_interface.
Here is my attempt:
$data = "";
for($i=0;$i<1000000000;$i++) $data .= "t";
$context_options = array (
'http' => array (
'method' => 'POST',
'header'=> "Content-type: application/x-www-form-urlencoded\r\n"
. "Content-Length: " . strlen($data) . "\r\n"
. "header: User-Agent:MyAgent/1.0\r\n",
'content' => $data
)
);
$context = stream_context_create($context_options);
$fp = fopen('http://localhost/users/inbound_interface', 'r', false, $context);