# Upload file to new page with history and access from admin

**URL:** <https://forum.getkirby.com/t/upload-file-to-new-page-with-history-and-access-from-admin/4350>\
**Category:** Questions\
**Tags:** v2\
**Created:** [June 7, 2016, 5:23pm UTC](https://forum.getkirby.com/t/upload-file-to-new-page-with-history-and-access-from-admin/4350 "2016-06-07T17:23:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lonelyalien](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@lonelyalien](https://forum.getkirby.com/u/lonelyalien)\
**Post date:** [June 7, 2016, 5:23pm UTC](https://forum.getkirby.com/t/upload-file-to-new-page-with-history-and-access-from-admin/4350/1 "2016-06-07T17:23:42Z")

</div>

Simple question, difficult execution? In short, I’d want to create a form where a authenticated user (without panel access, the client) can upload a file, in which a page gets made where only the currently authenticated user has access to. Whenever the user uploads a new file, this file gets added to the list. The admin should be able to view every client user’s uploaded files from the front-end.

I know how to make most of the parts, but miss the golden recipe sauce to connect the uploading from the form to creating a new page. Any tips & tricks to make this work?

---

<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:** [June 7, 2016, 6:01pm UTC](https://forum.getkirby.com/t/upload-file-to-new-page-with-history-and-access-from-admin/4350/2 "2016-06-07T18:01:59Z")

</div>

Check out this post: [Allow guests to create pages from Panel or frontend](https://forum.getkirby.com/t/allow-guests-to-create-pages-from-panel-or-frontend/2854/4)

Hope this is what you are looking for, because I am not quite sure I understand correctly what you want to achieve.

---

<div class="post-metadata">

**Author:** ![lonelyalien](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@lonelyalien](https://forum.getkirby.com/u/lonelyalien)\
**Post date:** [June 8, 2016, 7:49am UTC](https://forum.getkirby.com/t/upload-file-to-new-page-with-history-and-access-from-admin/4350/3 "2016-06-08T07:49:26Z")

</div>

Okay, I’m getting there. Follow-up question for something I can’t even seem to find a clue in the Toolkit APIs. I’m using a page hook on `panel.user.create`. Is it possible to get the username from the user that gets created in a variable I can use in a hook? I was looking on how Kirby saves the username and other profile information when it’s doing it’s job, but I think it’s protected to not let outside code interfere with it.

---

<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:** [June 8, 2016, 7:55am UTC](https://forum.getkirby.com/t/upload-file-to-new-page-with-history-and-access-from-admin/4350/4 "2016-06-08T07:55:06Z")

</div>

The panel.user.create hook provides the user object, so you should be able to access the username within that hook:

```auto
kirby()->hook('panel.user.create', function($user) {
  $username = $user->username();
});

```

---

<div class="post-metadata">

**Author:** ![lonelyalien](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@lonelyalien](https://forum.getkirby.com/u/lonelyalien)\
**Post date:** [June 8, 2016, 8:14am UTC](https://forum.getkirby.com/t/upload-file-to-new-page-with-history-and-access-from-admin/4350/5 "2016-06-08T08:14:12Z")

</div>

Oops, that did the trick. Thanks!

---

<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 6, 2025, 4:57pm UTC](https://forum.getkirby.com/t/upload-file-to-new-page-with-history-and-access-from-admin/4350/6 "2025-02-06T16:57:50Z")

</div>


