dreamwest Posted May 21, 2009 Share Posted May 21, 2009 how can i check the filesize of a file, i need to make sure its above 0.5mb (500kb). Ive done this below but im not sure if its right $file = "file.mpg"; if (filesize($file) < 500kb){ unlink($file); } Link to comment https://forums.phpfreaks.com/topic/159025-filesize/ Share on other sites More sharing options...
co.ador Posted May 21, 2009 Share Posted May 21, 2009 $file ='file.mpg'; if( filesize($file) <500) { unlink($file); } use single qoutes and take out the kb after the 500 number This is one i used less because the file I had was 70o and something kb I am amaze this is my first time helping someone efficiently. Good luck in your path Link to comment https://forums.phpfreaks.com/topic/159025-filesize/#findComment-838655 Share on other sites More sharing options...
dreamwest Posted May 21, 2009 Author Share Posted May 21, 2009 Yeah i wasnt sure if filesize() function was in bytes or kilobytes Thanks Link to comment https://forums.phpfreaks.com/topic/159025-filesize/#findComment-838673 Share on other sites More sharing options...
Ken2k7 Posted May 21, 2009 Share Posted May 21, 2009 It uses bytes. man filesize Link to comment https://forums.phpfreaks.com/topic/159025-filesize/#findComment-838684 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.