Admin panel field display file size

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

Hi 

Please kindly see the attachment.

We have upload feature on our site.

How to display file size on admin panel?

Thanks!

-Jax H.

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

-Jax H.

By Damon - November 20, 2013

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!

-Jax H.

By Dave - November 21, 2013

Hi JH, 

Note that we don't support custom modifications to the CMS, but give this a try:

Open /cmsAdmin/lib/menus/default/uploadList.php and search for: Filename:

Add the code in red:

<?php et('Filename:'); ?> <?php echo htmlspecialchars(pathinfo($row['filePath'], PATHINFO_BASENAME)); ?>
<?php $bytes = @filesize($row['filePath']); ?>
<?php if ($bytes) { echo formatBytes($bytes); } ?>

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com

Hi

Great now!

Hope the feature could be added in the new release.

Thanks!

Jac

-Jax H.