sugan Posted October 4, 2007 Share Posted October 4, 2007 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 More sharing options...
boen_robot Posted October 4, 2007 Share Posted October 4, 2007 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 More sharing options...
sugan Posted October 5, 2007 Author Share Posted October 5, 2007 Hey this is not working and i am using PHP4. Pls help!Regards,Sugan Link to comment Share on other sites More sharing options...
zppblood Posted October 6, 2007 Share Posted October 6, 2007 <?phpecho filesize('http://localhost/easycalcualtion/images/t3.gif');?> Put ' or " around strings. Link to comment Share on other sites More sharing options...
sugan Posted October 6, 2007 Author Share Posted October 6, 2007 Hi,I tried both but nothing is working.Regards,Sugan Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.