My client code is:
$Client = new Zend_Http_Client(
$url,
array(
'maxredirects' => 1,
'timeout' => 5,
'useragent' => 'LMS_LiveAccess'
)
);
$Client->resetParameters();
$Client->setMethod(Zend_Http_Client::POST);
$Client->setFileUpload('/home/itaymoav/outer.xml','outer.xml');
$Client->request();
On my server, when I do var_dump($_FILES)
I do see the file name and the correct size.
outer_xml = Array
(
name = outer.xml
type = text/plain
tmp_name = /home/itaymoav/files/phpecWKHK
error = 0
size = 1752
)
But when I go to the temp folder (where the $_FILES
tells me it saved the file) it is empty.
I both tried the tmp folder and a different folder with chmod 777. nothing.
What am I missing?
To save the uploaded file, you must move them to another location, like this.
From the manual, it says,
Here is an simple example.