Jump to content

filesize


sugan
 Share

Recommended Posts

Hi,How to know url file size without downloading it?lets say i have the image:

[a href=\"http://localhost/easycalcualtion/images/t3.gif\" target=\"_blank\"]http://localhost/easycalcualtion/images/t3.gif[/a]

how can i know its size (kb\mb\...) without downloading the picture Regards,Sugan

Link to comment
Share on other sites

Provided you have PHP5:

<?phpecho filesize(http://localhost/easycalcualtion/images/t3.gif);?>

Or in other words, the filesize() function. It returns it in bytes. If you want it in KBs, just divide by 1024. And for MBs, devide the KBs to yet another 1024.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...