milesj/cake-uploader — Issue #35: Dynamic filename with Model data
Author: vitto
Created: 2012-01-24 17:33:36+00:00
State: open

Hi, I'd like to say first this plugin is very easy to use and with tons of option to set.

I'd like to set the filename I've uploaded with the model id, so if I have filename.jpg I would like to save it with a name like 293847.jpg for example.

Everything is simple and clear but I missing how to do this specific task.

I've saw there is a way to create dynamic filenames through the Model like set a function outside the Controller as described in the documentation page, so:

```php
array (
'avatar' => array (
'name' => 'avatarFilename',
// etc...
?>

Model->id in some way to rename the file?
}

class ModelNameController extends AppController {
// etc...
}
?>
```

I've tested it but I still don't know hot to retrieve the Model id from the global function when I call it.
I'm not skilled in CakePHP so It's not clear for me how to solve the problem, I could asking something obvious.