Hello,

I have a page where i can upload images. Now i need to copy the uploaded images to a third party server. I have the details of that page. so can anyone help me.

Thank You.

here is my code to copy files to images folder in root directory. how can i make that copy to another server..

if ($_FILES["file1"]["error"] > 0 && $_FILES["file2"]["error"] > 0 )
        {
            echo "Return Code: " . $_FILES["file1"]["error"] . $_FILES["file2"]["error"] . "<br />";
        }
        else
        {  
           /* echo "Upload: " . $_FILES["file"]["name"] . "<br />";
            echo "Type: " . $_FILES["file"]["type"] . "<br />";
            echo "Size: " . ($_FILES["file1"]["size"] / 1024) . " Kb<br />";
            echo "Size: " . ($_FILES["file2"]["size"] / 1024) . " Kb<br />";
            echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
            */
            if (file_exists("images/$dirname/" . $_FILES["file1"]["name"]))
            {
                echo $_FILES["file1"]["name"] . " already exists. ";
            }
            else if (file_exists("images/$dirname/" . $_FILES["file2"]["name"]))
            {
                echo $_FILES["file2"]["name"] . " already exists. ";
            }
            else
            {  
                $dirname=$_POST['first_name'] . $_POST['last_name'];   
                $path="images/$dirname";
                if(!is_dir($path))
                {
                   @mkdir($path,0777,true);
                }
                move_uploaded_file($_FILES["file1"]["tmp_name"],"images/$dirname/" . $_FILES["file1"]["name"]);
                move_uploaded_file($_FILES["file2"]["tmp_name"],"images/$dirname/" . $_FILES["file2"]["name"]);
                  //echo "Stored in: " . "images/$dirname" . $_FILES["file"]["name"];
                $src1="images/$dirname/" . $_FILES["file1"]["name"];
                $src2="images/$dirname/" . $_FILES["file2"]["name"];
            }
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.