你可以用 file_exists() 函数检查文件夹是否存在, 否则 mdir()!

解决方案 »

  1.   

    我的意思是文件夹是我早建好的,但是程序返回not exists
      

  2.   

    $temporary_directory = "./temporary_files/";这样呢?
      

  3.   

    PHP.ini文件有没有设置?
    upload_tmp_dir=指向的目录是在那里?最好是在你PHP安装文同个文件夹下。
      

  4.   

    $temporary_directory = "./temporary_files/"; 这样不行,"temporary_files/";这样写不就是相对路径吗,upload_tmp_dir在.ini里是注释掉的,这个是干什么用的,跟这个有关系么
      

  5.   

    <?php
      $temporary_directory = "C:\Apache Group\Apache2\htdocs\mail\temporary_files";
      if(file_exists($temporary_directory))
      {
       echo "The file exists";

    else 
    {
        echo "The file does not exist";
    } if(!is_writable($temporary_directory)) die("<h3>The folder \"$temporary_directory\" do not exists or the webserver don't have permissions to write</h3>");
      echo "over";
      ?>结果是:
    The file exists
    The folder \"$temporary_directory\" do not exists or the webserver don't have permissions to write
    为什么is_writable判断是不存在?
      

  6.   

    is_writable
    (PHP 4, PHP 5)is_writable -- 判断给定的文件名是否可写
      

  7.   

    现在问题找到了,就是is_writeable不能判断存在的文件夹,又写个测试,
    <?php
    $filename = 'temporary_files/';if (is_writable($filename)) {
        echo 'The file is writable';
    } else {
        echo 'The file is not writable';
    }if(file_exists($filename))
      {
       echo "The file exists";

    else 
    {
        echo "The file does not exist";
    }
    ?〉
    结果是
    The file is not writable
    The file exists
    ,那怎么设置才能让文件夹writeable?
      

  8.   

    chmod()
    函数修改文件夹权限