Hi all,

I am using David Persson's Media behavior (along with the Transfer
behavior) http://wiki.github.com/davidpersson/media/media-behavior so
a user can upload photos to my site and they will then be saved out in
different sizes. While this is working I am having an issue getting
them to save into the right folders.

In my model I have the following
var $actsAs = array('Searchable', 'Containable',
                            'Media.Transfer' => array(
                                'trustClient'     => false,
                                'destinationFile' =>
'media:DS::Model.name::DS::year::DS::uuid:.:Source.extension:',
                                'baseDirectory'   => MEDIA_TRANSFER,
                                'createDirectory' => true,
                                ),
                                'Media.Media'=> array(
                                        'metadataLevel' => 0,
                                        'baseDirectory' => MEDIA,
                                        'makeVersions' => true,
                                        'filterDirectory' => MEDIA_FILTER,
                                        'createDirectory' => true,
                                    ),

        );

And in the plugin config core.php file I have the following

if (!defined('MEDIA')) {
                define('MEDIA', WWW_ROOT . 'media' . DS);
        }
if (!defined('MEDIA_URL')) {
                define('MEDIA_URL', 
'http://mytestserver.com/app/webroot/media/');
                }
if (!defined('MEDIA_FILTER')) {
                define('MEDIA_FILTER', '/home/www/mytestserver.com/app/webroot/
media/' );
        }

What happens when I upload a photo is the original is stored in
http://mytestserver.com/app/webroot/media/ and the versions are stored
in 
http://mytestserver.com/app/webroot/media/filter/m/home/www/mytestserver.com/app/webroot/media/Photo/2010

My goal is to have the versions live one directory below 'media' so
the path would be http://mytestserver.com/app/webroot/media/m/ (for
medium) http://mytestserver.com/app/webroot/media/xl/ (for extra
large). I have tried to test different MEDIA_FILTER options (' ', '/'
'/filter/') but nothing seems to work properly.  Has anyone used this
plugin successfully?  Does anyone have a suggestion as to where I may
be going wrong.

Thanks a bunch.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to