FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

How can i save the File url into database? #487

Closed upworkmkd closed 6 years ago

upworkmkd commented 6 years ago

Is there a way to save the file url in table like

$this->addBehavior('Josegonzalez/Upload.Upload', [
    'uploads' => [
        'tablefield'=>function(){
            return $this->modal.$this->filename;
        }
    }],
]);

So that i can save the file path into db

jorisvaesen commented 6 years ago

Please have a look at the documentation, there is a dir option under fields which allows you to set the database field for the file path.