Need bytes (filesize) for podcast MP3 upload

6 posts by 3 authors in: Forums > CMS Builder
Last Post: August 18, 2011   (RSS)

Re: [dwelling] Need bytes (filesize) for podcast MP3 upload

By Dave - August 16, 2011

Hi Jeremy,

Try this inside your foreach loop that displays uploads:
Size: <?php echo filesize($upload['filePath']) ?><br/>

Just put the PHP tag where you want the count of bytes displayed. If that doesn't work feel free to attach your viewer file and I'll take a look for you.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Need bytes (filesize) for podcast MP3 upload

By dwellingproductions - August 16, 2011

Thank you Dave!!!!!

That works perfectly! (Much better than the mess I was making.) :-)

I really appreciate the assistance.

All the best!

- Jeremy
---------------------------

Dwelling Productions

www.dwellingproductions.com

Re: [Dave] Need bytes (filesize) for podcast MP3 upload

By Toledoh - August 18, 2011

Is there an easy way to change the display of this from bytes to kilobytes?
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Need bytes (filesize) for podcast MP3 upload

By Dave - August 18, 2011

Hi Tim,

We have a built in function that shows k, mb, etc.

Instead of this:
Size: <?php echo filesize($upload['filePath']) ?><br/>

Try this:
Size: <?php echo formatBytes( filesize($upload['filePath']), 0) ?><br/>

The second number is how many decimals to show.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Need bytes (filesize) for podcast MP3 upload

By Toledoh - August 18, 2011

Brilliant!
Cheers,

Tim (toledoh.com.au)