如何才能让目录/images/有写的权限。
我的是在win2000的apache下。

解决方案 »

  1.   

    //transfile.php 
    <?php
    copy($myfile,"/images/".$myfile_name);
    //你的form里<input name="myfile" type="file">,这里怎么是 $myfile_name呢?
    echo "success";
    ?>
      

  2.   

    处理 form 的 action 程序 transfile.php,会主动产生四个变量
    变量名  说明 
    $myfile 即上传的文件内容 
    $myfile_name 上传文件在用户端的名称 
    $myfile_size 上传文件的大小 
    $myfile_type 上传文件的格式,如 "image/gif" 
    若在 form 中配置 input file 的名称改掉,则在 transfile.php的变量也一起改,如<input name="upfile" type="file">则变量就改成 $upfile、$upfile_name、$upfile_size、与 $upfile_type。
      

  3.   

    #httpd.conf
    <Directory "e:/www/images">
        Options All
        AllowOverride All
    </Directory>
    -----------------------------------------------------------------
    但,按你的Warning: Unable to open '' for reading: Permission denied in e:\www\php_exam\transfile.php on line 2
    Unable to open ''而没写成 Unable to open 'somefile.ext'...
      

  4.   

    我试了一下:
    Warning: Unable to create '/images/53.jpg': No such file or directory in c:\apache1.3.22\htdocs\test\transfile.php on line 2我改为
    //transfile.php 
    <?php
    copy($myfile,"c:/apache1.3.22/htdocs/images/".$myfile_name);
    echo "success";
    ?>
    就通过了。不知为何相对路径不行。学习中...
      

  5.   

    在WIN下不能那样写,只能写绝对路径
      

  6.   

       我可以保证相对路径是可以用的,这里有两个问题需注意,一是相对路径的正确性(../ /),二是ntfs格式下的写权限。
      

  7.   

    '/images/53.jpg'如果在超连接中第一个‘/’有根的含义,可以写'images/53.jpg',或者'./images/53.jpg'
    第一个问题应该是权限不够,如果是ntfs应该检查系统中和apache中的
    权限问题