Hi all! I'm trying to upload a file with cakePHP. This is the view:
echo $form->create(null, array('action' => 'upload', 'type' => 'file'));
echo $form->file('img');
echo $form->submit('Enviar Imagem');
echo $form->end();
And this is the error I'm getting:
Warning (2): Invalid argument supplied for foreach() [CORE/cake/dispatcher.php, line 314]
Edit: cakePHP's debug tells me that these are the lines of code where the problem happens:
foreach ($_FILES['data'] as $key => $data) {
foreach ($data as $model => $fields) {
foreach ($fields as $field => $value) {
And this is the call stack:
Dispatcher::parseParams() - CORE/cake/dispatcher.php, line 314
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 118
[main] - APP/webroot/index.php, line 88
My upload function is currently empty. What is happening?