更改Meioupload中的文件名

I'm using Meioupload on a website built with CakePHP, and it is working fine for having multiple upload fields. The problem I have now is that if person A uploads a picture called 'me.jpg' and then person B uploads a picture called 'me.jpg', person B's will overwrite the first upload.

Is there a way in Meioupload to change the filename as the picture is uploaded? E.g. add the person's username to the start so it would look like 'persona_me.jpg' and 'personb_me.jpg'?

This is the code I currently have:

var $actsAs = array('MeioUpload' => array(
    'picture' => array(
        'dir' => 'files/device_images',
        'create_directory' => true,
        'allowed_mime' => array('image/jpeg', 'image/pjpeg', 'image/gif', 'image/png'),
        'allowed_ext' => array('.jpg', '.jpeg', '.png', '.gif'),
        'thumbsizes' => array(
               'small'  => array('width'=>100, 'height'=>100),
               'medium' => array('width'=>240, 'height'=>180),
               'large'  => array('width'=>640, 'height'=>480)
    )));

Thanks for any help

Add this in your Meio Upload declaration: 'uploadName' => 'url_slug', where url_slug is field you are submitting with the form (actually, it might be a field in the schema, it's both on my app).

from what I can remember when i was using meio upload, images were placed in a directory with the name of the pk, something like /images//filename.ext

for the most part you want to keep the file name, as it can be used for SEO.