Create Folders on file upload

Hi everyone,

i have a little problem with my file upload.
I have Tickets with multiple TicketSnaps. Each TicketSnap can also have a uploaded picture or pdf.
I want that all pictures go into one folder named as the Ticket.

I thought this line would do it.

'path' => 'webroot/uploads/{field:ticket_id}', // Create a folder for each ticket

but as you can see in the pictures my folders are now named

{field:ticket_id}

Here the full function

 public function initialize(array $config): void
    {
        parent::initialize($config);

        $this->setTable('ticket_snaps');
        $this->setDisplayField('id');
        $this->setPrimaryKey('id');

        $this->addBehavior('Timestamp');

        $this->belongsTo('Tickets', [
            'foreignKey' => 'ticket_id',
            'joinType' => 'INNER',
        ]);
        $this->belongsTo('Users', [
            'foreignKey' => 'user_id',
            'joinType' => 'INNER',
        ]);


        $this->addBehavior('Josegonzalez/Upload.Upload', [
            'photo' => [
                'path' => 'webroot/uploads/{field:ticket_id}', // Create a folder for each ticket
            ],
        ]);

    }

The ticket_id should be present and is stored correct in the DB.

Thank you :pray:

Hey Leute,

Das Problem ist gelöst.
GPT-40 wusste es nicht aber die 01-Preview konnte mir helfen. :partying_face:

Das Problem liegt darin, dass der Platzhalter {field:ticket_id} nicht korrekt interpretiert wird. Im josegonzalez/cakephp-upload Plugin sollte der Platzhalter für ein Feld folgendermaßen geschrieben werden: {field-value:ticket_id}.