Hi
I would ask another question about media plugin:

In my attachment model I have this configuration for Media.Transfer:


'Media.Transfer' => array(
   'trustClient'     => false,
   'destinationFile' =>
':Medium.short::DS:attachments:DS::Model.id::DS:attachment.:Source.extension:',
   'baseDirectory'   => MEDIA_TRANSFER,
   'createDirectory' => true,
   'alternativeFile' => 100
  ),

The problem is the marker Model.id when I add a NEW attachment ,
because the marker have no vlaue infact I get this error :

"
TransferBehavior::_replaceMarker - Failed to replace all markers of
subject `img\attachments\unknown_marker\attachment.jpg`. Did you setup
the behavior correctly? Check the configuration you provided for
TransferBehavior in your `Attachment` model.
[APP\plugins\media\models\behaviors\transfer.php, line 840
"

I would know if is it possible to use field of Model to config
destinationFile?

Many Thanks
Marco

On 7 Lug, 07:01, randy <ran...@gmail.com> wrote:
> Quick reply to answer your questions...
>
> My directory structure is like the first one, with app/webroot/
> transfer instead of app/webroot/media/transfer.
>
> I'd like to not serve EVERYmediafile from theplugin, so I'm going
> to do what I can to not pull my CSS into that directory structure.
> So...my styles are still being applied.
>
> I'll gladly share my code and show what I'm doing, but I first will
> need to get stuff working.
>
> Still working on the UUID filenaming issue, but out-of-the-box it
> looks like it will NOT overwrite existing files.
>
> I'm also trying to figure out how to config the metadata stuff, I had
> this working before, but am unable to restore that functionality. I
> swear I saw this in the documentation but am not able to track down
> this bit. If you can point me in the right direction it would be
> appreciated.
>
> On Jul 6, 10:26 pm, dbme <boston.dus...@gmail.com> wrote:
>
> > Awesome! So what is your directory structure (step 3)?
>
> > Is it
>
> > app/webroot/media/static/
> > app/webroot/media/filter/
> > app/transfer/
>
> > OR
>
> > app/webroot/media/static/
> > app/webroot/media/filter/
> > app/webroot/media/transfer/
>
> > Also, did the styles still get served properly after step 5
> > (protecting the transfer directory)?
>
> > I would love to see how you made it work! Would you mind posting an
> > example or emailing me the relevant code?
> > If I can get it working I think it would be great to add this as a
> > full-on tutorial in the wiki.
>
> > Thank you!!
>
> > On Jul 6, 6:11 pm, randy <ran...@gmail.com> wrote:
>
> > > So glad to see someone else is taking a crack at this...
>
> > > Thanks to your post i was able to make a bit of headway...when i set
> > > this up the first time I had troubles with getting things right in my
> > > bootstrap.php file. However, i had a fairly easy time with other parts
> > > of this, namely the actual file-upload and metadata fields.
>
> > > I just set this up again using your instructions for bootstrap.php,
> > > and with just a few more adjustments I have it uploading files to the
> > > transfer directory and spitting out copies of the original, in
> > > different sizes.
>
> > > There are just two more things that I want to get working...I'd like
> > > to use theMediaHelper to pull in my uploaded images, and, most
> > > importantly, I'd like to get the file-renaming functionality working
> > > so that users don't overwrite each others files. This also makes it
> > > tough to guess filenames if people go fishing for the uploaded images.
>
> > > I am running this on a cake 1.3 setup in case anyone was wondering.
>
> > > On Jul 5, 1:30 pm, dbme <boston.dus...@gmail.com> wrote:
>
> > > > I'm just getting started with CakePHP and also David Persson'sMedia
> > > >plugin(http://github.com/davidpersson/media). I've got my app working
> > > > but I'm having a difficult time getting theMediapluginworking. I
> > > > figured I'd start this thread so I could A.) get it working and B.)
> > > > create a reference for beginners like me.
>
> > > > Here's what I've done so far (following the README and Configuration
> > > > wiki -http://wiki.github.com/davidpersson/media/configuration). Steps
> > > > marked with a * didn't go as documented :(
>
> > > > 1. Download and extract the files to /path/to/your/app/plugins/media
> > > > 2. Include theMediapluginconfig file in the /path/to/your/app/
> > > > config/bootstrap.php
>
> > > >         define ( 'MEDIA_TRANSFER', APP . 'transfer' . DS);
> > > >         define ( 'MEDIA_TRANSFER_URL', false);
> > > >         require APP . 'plugins/media/config/core.php';
>
> > > > * 3. Create the directory structure using the console
>
> > > > cd  /path/to/your/app/
> > > > ../cake/console/cakemediainit
>
> > > > The Configuration wiki says that there should be a static, filter, and
> > > > transfer directory under the webroot/media/ directory but the command
> > > > above will put the transfer directory under the app directory. Not
> > > > sure if this is how it should be or if I did something wrong.
>
> > > > * 4. Copy/move/collect themediainto the new location
>
> > > > ../cake/console/cakemediacollect
>
> > > > But this results in a bunch of errors :(
>
> > > > ---------------------------------------------------------------------------
> > > >  -----
> > > >MediaShell
> > > > ---------------------------------------------------------------------------
> > > >  -----
> > > > PHP Warning:  Invalid argument supplied for foreach() in /path/to/your/
> > > > app/plugins/media/vendors/shells/tasks/collect.php on line 119
>
> > > > Warning: Invalid argument supplied for foreach() in /path/to/your/app/
> > > > plugins/media/vendors/shells/tasks/collect.php on line 119
> > > > PHP Notice:  Undefined variable: pluginVendorPaths in /var/www/
> > > > portfolio/app/plugins/media/vendors/shells/tasks/collect.php on line
> > > > 130
>
> > > > Notice: Undefined variable: pluginVendorPaths in /path/to/your/app/
> > > > plugins/media/vendors/shells/tasks/collect.php on line 130
> > > > PHP Warning:  array_merge(): Argument #1 is not an array in /path/to/
> > > > your/app/plugins/media/vendors/shells/tasks/collect.php on line 130
>
> > > > Warning: array_merge(): Argument #1 is not an array in /path/to/your/
> > > > app/plugins/media/vendors/shells/tasks/collect.php on line 130
> > > > PHP Warning:  Invalid argument supplied for foreach() in /path/to/your/
> > > > app/plugins/media/vendors/shells/tasks/collect.php on line 132
>
> > > > Warning: Invalid argument supplied for foreach() in /path/to/your/app/
> > > > plugins/media/vendors/shells/tasks/collect.php on line 132
> > > > Would you like to add another path?
>
> > > > So I'm assuming maybe I've done something wrong. I will press on and
> > > > instead just move the files manually:
>
> > > > mv webroot/js/* webroot/media/static/js/
> > > > mv webroot/css/* webroot/media/static/css/
> > > > mv webroot/img/* webroot/media/static/img/
> > > > mv webroot/vendors/js/* webroot/media/static/js/
> > > > mv webroot/vendors/css/* webroot/media/static/css/
> > > > mv webroot/vendors/img/* webroot/media/static/img/
>
> > > > That works, minus the vendors directory (because I dont have one).
> > > > At this point the app is no longer styled. e.g. the stylesheet is not
> > > > in the proper path and afaik there isn't anything telling the app
> > > > where to find it. :-/
>
> > > > Next step.
>
> > > > * 5. Protect the transfer directory
>
> > > > ../cake/console/cakemediaprotect
>
> > > > Doesn't work. I just get the message: The content of the transfer
> > > > directory is not served. Guess I'll create this one manually as well.
>
> > > > nano transfer/.htaccess
>
> > > > Order deny,allow
> > > > Deny from all
>
> > > > Save and exit.
>
> > > > 6. Give up.
>
> > > > Actually I pressed on but there really isn't any thorough
> > > > documentation after this point.
>
> > > > Any help would be appreciated. I'd love to put together some
> > > > documentation that would help other n00bs like me get this thing set
> > > > up.
>
>

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