How do I find the download size of a file?

advertisements

I am facing a problem in one of my website.I have applied download data limit check and user have the option to download files in his/her profile.My question is:

How to find the download size of a file? So, I have applied the appropriate limit checks.


You could use PHP's filesize() function:

$size = filesize('/path/to/file');

This will return the size of the file in bytes.