# Upload path dynamically

**URL:** <https://discourse.cakephp.org/t/upload-path-dynamically/2147>\
**Category:** Need Help\
**Created:** [February 23, 2017, 10:25am UTC](https://discourse.cakephp.org/t/upload-path-dynamically/2147 "2017-02-23T10:25:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitch26](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mitch26/32/535_2.png) [@mitch26](https://discourse.cakephp.org/u/mitch26)\
**Post date:** [February 23, 2017, 10:25am UTC](https://discourse.cakephp.org/t/upload-path-dynamically/2147/1 "2017-02-23T10:25:06Z")

</div>

Hi,

how can i define a dynamic path for every file that i want to save in my database?

e.g.

file\_1 = c:\objects$name\folder\_1  
file\_2 = c:\objects$name\folder\_2  
file\_3 = c:\objects$name\xxx

in the readme.rst i read about:

```
<?php
    // app/Model/User.php
    $this->Behaviors->Upload->settings['field']['path'] = $newPath;
    ?>

```

but i don’t know how i have to implement that for this problem.

Thanks for help.

---

<div class="post-metadata">

**Author:** ![SATHISH](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@SATHISH](https://discourse.cakephp.org/u/SATHISH)\
**Post date:** [February 24, 2017, 11:22am UTC](https://discourse.cakephp.org/t/upload-path-dynamically/2147/2 "2017-02-24T11:22:16Z")

</div>

Hi,

You can use proffer plugin for file uploading . You can also customize your file path.

[Check here…](https://github.com/davidyell/CakePHP3-Proffer)

---

<div class="post-metadata">

**Author:** ![mitch26](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mitch26/32/535_2.png) [@mitch26](https://discourse.cakephp.org/u/mitch26)\
**Post date:** [February 24, 2017, 11:53am UTC](https://discourse.cakephp.org/t/upload-path-dynamically/2147/3 "2017-02-24T11:53:20Z")

</div>

Thanks Sathish,

but i need it for cakephp 2.x
