bmcclure/CakePHP-Media-Plugin — Issue #4: Image is not uploaded to transfer folder
Author: PHANTOMIAS
Created: 2012-01-10 21:09:33+00:00
State: open

I have CakePHP 2.0.2 and the latest version of yours CakePHP Media Plugin.

I uploaded all files to 'app/Plugin/media' and I created these directory by myself:
- app/Plugin/media/filter/
- app/Plugin/media/static/
- app/Plugin/media/transfer/

Each folder has these subfolders:
-- aud/
-- doc/
-- gen/
-- img/
-- vid/

In 'app/Config/core.php' I added this line
require_once(APP.'Plugin'.DS.'media'.DS.'Config'.DS.'core.php');
in the last line of this core.php file.

And this line in 'app/Config/bootstrap.php':
CakePlugin::load('Media');

In my 'app/View/Regions/add.ctp':

Form->create('Region', array('type' => 'file'));
echo $this->Form->input('name');
echo $this->Form->input('file', array('type' => 'file'));
echo $this->Form->end('Add Region');
?>

In the Model 'app/Model/Region.php', I added this lne:
var $actsAs = array('Media.Transfer');

In 'app/Controller/RegionsController.php':

public function add() {
if ($this->request->is('post')) {
debug($this->request->data);
}
}

The data has all the image data:

Array
(
[Region] => Array
(
[name] => ddd
[file] => Array
(
[name] => test.jpg
[type] => image/jpeg
[tmp_name] => /var/www/test/phptmp/phpNGHHYm
[error] => 0
[size] => 51827
)
)
)

Now I read in the tutorial file which is located under 'app/Plugin/media/docs/TUTORIAL':

If you now go and repeat submitting the file via the add form, this
time the file should end up being stored below webroot/media/transfer
in img/clipboard.jpg.

But in my case, there is no test.jpg image in this folder, and there is no error message. So what's the problem?
I also added .htaccess files with content
Order deny,allow
Deny from all
but that should not be the problem.

Anyone an idea?