FAQ
I am using David Perssons media plugin<https://github.com/davidpersson/media>in 1.3 environment and I have more of an advanced usage question.

Basically, I have existing model records that rely on a model field (slug)
as part of the path to the image. Since this is a join table, the user can
change the association to another record, making the media path invalid.
Basically I have videos that belong to a show, and the show slug is used as
part of the path. When users change shows (if they accidentally place the
video in the wrong show) the dirname path is now invalid and the file is in
the wrong place.

I am trying to figure out how/if I can use the media plugin to move the
file from the original path, to a new path. I know how to do that using the
beforeSave (detect change) and afterSave (move if needed) but I'd like to
use the media plugin to make the move as it automatically handles filename
changes (adding -2 if the file exists) and handles the paths for you.

Any thoughts?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcake-php @
categoriesphp
postedJun 21, '12 at 4:34p
activeJun 21, '12 at 4:34p
posts1
users1
websitecakephp.org
irc#cakephp

1 user in discussion

Paul Redmond: 1 post

People

Translate

site design / logo © 2022 Grokbase