有人租用51.net空间并且已经实现文件上传的,可以把源码贴出来吗。
不胜感激~!

解决方案 »

  1.   

    上传到哪个空间,上传到51的空间?用表单。
    用php做ftp程序的话,空间得支持才行。
      

  2.   

    随手写的很简单的上传程序例子:
    你在空间新建一目录名为:  up  ,并一定要将其"属性"设为"777"
    这是上传的叶面:index_a.htm
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>上传文件叶</title>
    </head><body>
    <form action="index_up.php" method="post" enctype="multipart/form-data" name="form1">
      <input type="file" name="file">
      <input type="submit" name="Submit" value="OK上传">
    </form>
    </body>
    </html>
    ////////这是上传处理页面:index_up.php
    <?PHP
    if(copy($file,"$file_name"))
    {
    echo "上传成功.你上传的文件名是:$file_name";
    }
    else
    echo "上传失败!!!";
    ?>
      

  3.   

    <form action="index_up.php" method="post" enctype="multipart/form-data" name="form1">
      <input type="file" name="workpicture ">
      <input type="submit" name="Submit" value="OK上传">
    </form>$photo_dir = "../for4/upload/";
    $maxfilesize = 200; 
    $workerid=$worker[workerid];if(strval($workpicture != ""))
    {    if($workpicture_size > ($maxfilesize*1024)){
                print "<div align=center>图片文件大于200K!,请为你的图片减肥";
                print "<br><br><a href=javascript:window.history.back()>返回</a></div>";
                exit;
        }
        if($workpicture!="none"){
             $workpicture_path="$photo_dir$workerid"."_work.gif";
             copy($workpicture, $workpicture_path);
             unlink($workpicture);
             chmod($workpicture_path, 0777);
        }
    }
      

  4.   

    51.net的php版本过低。真是恼火。很多东西不能用。