doulezhi5326 2015-08-26 07:19
浏览 20

移动上传到另一个pc / ip地址的文件

I just wanna ask if its possible to make directory and store the uploaded file in it to a shared folder from another pc using mkdir and move_uploaded_file. I tried doing it locally it works fine but when i try this code

if($_REQUEST['submit']){
    $app_name = $_POST['name'];
    $desc = $_POST['description'];
    $file_url = "192.168.3.34/testupload/files/$app_name/" . $_FILES["file"]["name"];
    $photo_loc = "192.168.3.34/testupload/images/$app_name/" . $_FILES["photo"]["name"];
    $select = $_POST['select'];
    $date = date('m/d/y h:i:s A');

    mkdir("192.168.3.34/testupload/files/$app_name/");
    mkdir("192.168.3.34/testupload/images/$app_name/");
    /* some codes here  that is working */

    if($file != "" ){
        if (file_exists("..192.168.3.34/testupload/files/$app_name/" . $_FILES["file"]["name"]) && file_exists("..192.168.3.34/testupload/images/$app_name/" . $_FILES["photo"]["name"])) {
            die("File Exists");
        }
        move_uploaded_file($_FILES["file"]["tmp_name"],
            "192.168.3.34/testupload/files/$app_name/" . $_FILES["file"]["name"]);


        if($photo_url != "") {
            move_uploaded_file($_FILES["photo"]["tmp_name"],
                "192.168.3.34/testupload/images/$app_name/" . $_FILES["photo"]["name"]);

        }
        $name = escape($_REQUEST['name']);
        $description = escape($_REQUEST['description']);
        //$query = "INSERT into files (name, description,file_name,photo_url,date_uploaded) values ('{$name}', '{$description}','{$file}', '{$photo_url}', now() )";
        //mysql_query($query) or die("Error in Query" . mysql_error());

        //commit();
        //redirect("manage.php");

        $file_loc = "192.168.3.34/testupload/files/$app_name/" . $_FILES["file"]["name"];
        $photo_loc = "192.168.3.34/testupload/images/$app_name/" . $_FILES["photo"]["name"];
    }
}else{
    set_error("File not Found");
    //redirect('manage.php');
}

i tried to change the "/" in "\" and still getting this error

Warning: mkdir() [function.mkdir]: No such file or directory in C:\xampp\htdocs\atts_update\upload.php on line 12

Warning: mkdir() [function.mkdir]: No such file or directory in C:\xampp\htdocs\atts_update\upload.php on line 13

Warning: move_uploaded_file(192.168.3.34/testupload/files/1111111111111/sss.txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\xampp\htdocs\atts_update\upload.php on line 71

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\xampp\tmp\php610B.tmp' to '192.168.3.34/testupload/files/1111111111111/sss.txt' in C:\xampp\htdocs\atts_update\upload.php on line 71

Warning: move_uploaded_file(192.168.3.34/testupload/images/1111111111111/Picture-in-a-picture4aaa.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\xampp\htdocs\atts_update\upload.php on line 76

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\xampp\tmp\php611C.tmp' to '192.168.3.34/testupload/images/1111111111111/Picture-in-a-picture4aaa.jpg' in C:\xampp\htdocs\atts_update\upload.php on line 76

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 vscode问题请教
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM