Has anybody expierience with 'blueimp / jQuery-File-Upload' in combination with Zend Framework 2? I am struggeling to get is working.
The form seems to do his thing and works but when the controllers wants to do his magic, I am stuck.
This is my function that is called by the script to upload and save the files.
public function indexAction()
{
$request = $this->getRequest();
$files = $request->getFiles();
$httpadapter = new \Zend\File\Transfer\Adapter\Http();
if($httpadapter->isValid()) {
$httpadapter->setDestination('data/images/uploads/');
$httpadapter->receive($files);
$return = 'valid';
} else {
// Form not valid, but file uploads might be valid...
// Get the temporary file information to show the user in the view
$return = $httpadapter->getMessages();
}
return new \Zend\View\Model\JsonModel(array($return));
}
The return I get is:
[{"fileUploadErrorFileNotFound":"File images1.jpeg was not found"}]
print_r($files) gives me this output:
Zend\Stdlib\Parameters Object
(
[storage:ArrayObject:private] => Array
(
[files] => Array
(
[0] => Array
(
[name] => images1.jpeg
[type] => image/jpeg
[tmp_name] => /private/var/tmp/phpa3IOwX
[error] => 0
[size] => 10185
)
)
)
)
Can anybody help me so I can upload files?
greetings,