3

I am have uploading site and I want to know how i can know the space of the server via php ?

for example:

if($_FILES ...) {
  if($server_rest_space enough for the file){
    // upload it!
}
else{
  echo 'no space on your server enough!'; //there is no space!!
}

important another question if the server is full! and some one uploaded file is there an error will happen ?

thank you

Book Of Zeus
  • 49,509
  • 18
  • 174
  • 171
Osama Tarek
  • 297
  • 5
  • 16
  • possible duplicate of [How to get the disk space on a server?](http://stackoverflow.com/questions/2425841/how-to-get-the-disk-space-on-a-server) – John Flatness Aug 26 '11 at 02:49

1 Answers1

5

Try to use disk_free_space()

NullUserException
  • 83,810
  • 28
  • 209
  • 234
Book Of Zeus
  • 49,509
  • 18
  • 174
  • 171