# Plugin Upload path

**URL:** <https://forum.getkirby.com/t/plugin-upload-path/21185>\
**Category:** Questions\
**Tags:** v3\
**Created:** [February 12, 2021, 9:37pm UTC](https://forum.getkirby.com/t/plugin-upload-path/21185 "2021-02-12T21:37:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![efavaro](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/efavaro/32/8395_2.png) [@efavaro](https://forum.getkirby.com/u/efavaro)\
**Post date:** [February 12, 2021, 9:37pm UTC](https://forum.getkirby.com/t/plugin-upload-path/21185/1 "2021-02-12T21:37:22Z")

</div>

Hi! I’m following [this](https://getkirby.com/docs/reference/plugins/internals/uploads) document on how to upload files to the panel in a custom field. But I don’t understand how can I get a url to the current page in the panel instead of using a absolute path to a dir.  
Below the example code. Thanks in advance!

```
<script>
export default {
  methods: {
    upload() {
      this.$refs.upload.open({
        url: window.panel.api + "/pages/projects+project-a/files"
      });
    }
  }
};
</script>

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 12, 2021, 10:26pm UTC](https://forum.getkirby.com/t/plugin-upload-path/21185/2 "2021-02-12T22:26:21Z")

</div>

Maybe `this.path` or something like that?

---

<div class="post-metadata">

**Author:** ![efavaro](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/efavaro/32/8395_2.png) [@efavaro](https://forum.getkirby.com/u/efavaro)\
**Post date:** [February 12, 2021, 10:42pm UTC](https://forum.getkirby.com/t/plugin-upload-path/21185/3 "2021-02-12T22:42:26Z")

</div>

Nop. And I tried outputing `this` to the console but I can’t find something that looks like an URL.

I also tried [Uploads | Kirby](https://getkirby.com/docs/reference/plugins/internals/uploads#handling-uploads-in-the-api__custom-route) that copies the file in a hook. But I also don’t know how to get an url there 🤦‍♂️

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 13, 2021, 11:06am UTC](https://forum.getkirby.com/t/plugin-upload-path/21185/4 "2021-02-13T11:06:15Z")

</div>

Maybe just simple JS?

```auto
window.location.pathname

```

But just in case I asked the team…

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 13, 2021, 11:14am UTC](https://forum.getkirby.com/t/plugin-upload-path/21185/5 "2021-02-13T11:14:38Z")

</div>

`this.$route.params.path` will get you the path of the current view.

---

<div class="post-metadata">

**Author:** ![efavaro](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/efavaro/32/8395_2.png) [@efavaro](https://forum.getkirby.com/u/efavaro)\
**Post date:** [February 13, 2021, 8:53pm UTC](https://forum.getkirby.com/t/plugin-upload-path/21185/6 "2021-02-13T20:53:41Z")

</div>

Thanks a lot! And how about when using a route? How can i get the url in php?

---

<div class="post-metadata">

**Author:** ![bastianallgeier](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bastianallgeier/32/7569_2.png) [@bastianallgeier](https://forum.getkirby.com/u/bastianallgeier)\
**Post date:** [February 15, 2021, 12:29pm UTC](https://forum.getkirby.com/t/plugin-upload-path/21185/7 "2021-02-15T12:29:27Z")

</div>

The field has a model method (`$this->model()`) which refers to the current page object. The page object has a panelUrl method. So you should be able to use `$this->model()->panelUrl()`
