Login | Sign up | Toll-Free: 1-800-752-0455
 
 

Forum

 

7 posts by 3 authors in: Forums > CMS Builder
Last Post: November 21, 2013

Hi 

Please kindly see the attachment.

We have upload feature on our site.

How to display file size on admin panel?

Thanks!

Hi JH,

To display the file size of an upload image in the admin, you would need to add code to the upload templates in CMS Builder.

This should work but any admin template file may be changed with a future update so it is a good idea to create your own custom changelog with
any changes that you make so they can be redone after upgrading in the future.

You can also output the filesize on the frontend of the size using the PHP filesize function. Here are some links for reference:

http://php.net/manual/en/function.filesize.php
http://johnveldboom.com/posts/17/quick-php-function-to-get-file-sizes-in-kb-mb-gb
http://stackoverflow.com/questions/5501427/php-filesize-mb-kb-conversion

---------------------------------------------------
Cheers,
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Hi Damon 

have no idea how to add the code.

Could you let me know where to modify the code? which file can be modify?

Thanks!

Jac

Hi Jac,

Without actually writing the code and testing it out, I'm not sure what the code needed would be but you could try adding code to this admin template:

/cmsAdmin/lib/menus/default/uploadList.php

around line 105.

We can also write this code for you through consulting. Probably would take about 30 minutes to write the code and test. If you are interested in getting it done by our consulting team, shoot us an email to consulting@interactivetools.com.

Thanks!

---------------------------------------------------
Cheers,
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Hi

I am trying to add below code on the file

/cmsAdmin/lib/menus/default/uploadList.php

<!--file size --> 
<?php

// outputs e.g. somefile.txt: 1024 bytes

$filename = 'upload';
echo $filename . ': ' . filesize($filename) . ' bytes';

?>
<!--file size -->

Can you kindly tell me which record I can use?

Thanks!

Hi

Great now!

Hope the feature could be added in the new release.

Thanks!

Jac