HTML5 Data Bindings Formatter Support Product Page

How can I display the size of a file?

Asked 06 Dec 2013 16:16:47
1
has this question
06 Dec 2013 16:16:47 Andre Bender posted:
How can I display the size of a file when I'm using the HTML5 Data Bindings (Formatter)?

I'm currently using a function like this:
        
<?php
$filepath = "../".$row_rsFiles['Filename'];
echo round_file_size(filesize($filepath)); 
?>


Replies

Replied 13 Dec 2013 07:21:21
13 Dec 2013 07:21:21 Andre Bender replied:
Any ideas?
Replied 18 Dec 2013 14:54:15
18 Dec 2013 14:54:15 Andre Bender replied:
Up
Replied 18 Dec 2013 15:24:55
18 Dec 2013 15:24:55 Teodor Kuduschiev replied:
Hello,
This is currently not supported but you can try one of the following suggestions:
- You can create a php file that outputs valid json, then you can load it as a dataset and use it in html5 data bindings

- You can try using this inline like: {{<?php echo filesize($file) ?>.formatNumber()}}
Replied 18 Dec 2013 15:54:08
18 Dec 2013 15:54:08 Andre Bender replied:
Hi Teodor.
I don't quite understand the 2nd suggestion. How or where do I define $file?
Replied 18 Dec 2013 17:15:21
18 Dec 2013 17:15:21 Teodor Kuduschiev replied:
Hello,
It is just an example of how you can use your php code inline with the data bindings. As i described currently it is not possible to show the size only using the database connector/data bindings/formatter.
Replied 18 Dec 2013 17:35:58
18 Dec 2013 17:35:58 Andre Bender replied:
I got that, but your inline code contains the {{}} for data binding and no content connected to the dataset. So I need to do something like $file={{File}}?

Reply to this topic