# Get fielsize from filemanager into module

**URL:** <https://community.hubspot.com/t/get-fielsize-from-filemanager-into-module/25872>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [September 23, 2020, 4:21pm UTC](https://community.hubspot.com/t/get-fielsize-from-filemanager-into-module/25872 "2020-09-23T16:21:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [September 23, 2020, 4:21pm UTC](https://community.hubspot.com/t/get-fielsize-from-filemanager-into-module/25872/1 "2020-09-23T16:21:33Z")

</div>

Hey fellow community members,

I’m building a module for our ressources page an would like to display the filesize of each file which is uploaded to the filemanager in a module which gets all the other information from a HubDB. The current workaround is a textfield where the colleague who will manage the HubDB can input a number and then it is displayed with the |filesize and a multiplier filter in the module. But since this isn’t very convinient convinient my idea was to automate this step.

Anybody an idea?

best,

Anton

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [September 23, 2020, 6:56pm UTC](https://community.hubspot.com/t/get-fielsize-from-filemanager-into-module/25872/2 "2020-09-23T18:56:24Z")

</div>

@Anton You can find that by using the [_ **file\_by\_id** _ HubL function](https://developers.hubspot.com/docs/cms/hubl/functions#file-by-id) like so:

```lia-code-sample
{% set file = file_by_id(123) %} 
{{ file.size }}
<!-- this will print the size in bytes -->

```

However, the issue I’ve run into with this is that it’s not very easy to get a file ID to use with this function since it’s not really a user facing ID or a field available in custom modules. If you find a way to surface this ID easily I’d love to know.

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [September 23, 2020, 8:23pm UTC](https://community.hubspot.com/t/get-fielsize-from-filemanager-into-module/25872/3 "2020-09-23T20:23:24Z")

</div>

Man, I feel kinda dumb right now 😀

Thank you very much. Works flawlessly with HubDB

Yeah, you’re right… It’s a bummer that if you use the “image” function in a custom module you only get the url and the sizes… If I come up with something I will keep you in touch.

Maybe with the new files API(when it’s gonna be availibe) you will be able to get the ID by file url

best,

Anton
