<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Get fielsize from filemanager into module in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Get-fielsize-from-filemanager-into-module/m-p/373202#M18796</link>
    <description>&lt;P&gt;Hey fellow community members,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anybody an idea?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2020 16:21:33 GMT</pubDate>
    <dc:creator>Anton</dc:creator>
    <dc:date>2020-09-23T16:21:33Z</dc:date>
    <item>
      <title>Get fielsize from filemanager into module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-fielsize-from-filemanager-into-module/m-p/373202#M18796</link>
      <description>&lt;P&gt;Hey fellow community members,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anybody an idea?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 16:21:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-fielsize-from-filemanager-into-module/m-p/373202#M18796</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2020-09-23T16:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get fielsize from filemanager into module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-fielsize-from-filemanager-into-module/m-p/373258#M18800</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;You can find that by using the &lt;A href="https://developers.hubspot.com/docs/cms/hubl/functions#file-by-id" target="_blank" rel="noopener"&gt;&lt;EM&gt;&lt;STRONG&gt;file_by_id&lt;/STRONG&gt;&lt;/EM&gt; HubL function&lt;/A&gt; like so:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set file = file_by_id(123) %} 
{{ file.size }}
&amp;lt;!-- this will print the size in bytes --&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 18:56:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-fielsize-from-filemanager-into-module/m-p/373258#M18800</guid>
      <dc:creator>stefen</dc:creator>
      <dc:date>2020-09-23T18:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get fielsize from filemanager into module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-fielsize-from-filemanager-into-module/m-p/373291#M18801</link>
      <description>&lt;P&gt;Man, I feel kinda dumb right now&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you very much. Works flawlessly with HubDB&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe with the new files API(when it's gonna be availibe) you will be able to get the ID by file url&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 20:23:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-fielsize-from-filemanager-into-module/m-p/373291#M18801</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2020-09-23T20:23:24Z</dc:date>
    </item>
  </channel>
</rss>

