How to detect the server space enough for the uploaded file or no?

怎甘沉沦 提交于 2019-12-23 17:36:04

问题


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


回答1:


Try to use disk_free_space()



来源:https://stackoverflow.com/questions/7199513/how-to-detect-the-server-space-enough-for-the-uploaded-file-or-no

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!