请将fopen前后相关代码发出来,

解决方案 »

  1.   


    fopen("ftp://test:[email protected]:21/xgvod/SUGEST.PHP","r");
    if (!$fo) 
       {
       echo "找不到文件"; 
       } 
      else 
      { 
       Header("Content-type: application/octet-stream"); 
       Header("Content-Disposition: attachment; filename=".$file_name); 
       while (!feof ($file)) 
        { 
         fread($file,50000); 
        };
        fclose ($file); 
        echo "下载完毕";
      }其中xgvod为,serv_u的虚拟目录,sugguest.php为脚本所在目录文件
    环境:
    apache2.46+php4.31+serv-U4.0+win2k
    php.ini  allow_url_fopen  on
             safe-mode  on
             现象:1、在地址栏直接录入ftp://test:[email protected]:21/xgvod/SUGEST.PHP可以显示
    2、直接运行程序,总提示“找不到文件”
    请赐教。
      

  2.   

    更正:
    第一行
    $fo=fopen("ftp://test:[email protected]:21/xgvod/SUGEST.PHP","r");
      

  3.   

    >>>>if (!$fo) 
    $fo  在哪里?并没有$fo=fopen("...........","r");  啊
      

  4.   

    更正:
    第一行
    $fo=fopen("ftp://test:[email protected]:21/xgvod/SUGEST.PHP","r");
      
      

  5.   

    xgvod/SUGEST.PHP你把这个目录换成文件所在操作系统的绝对路径看看
    不要用虚拟路径