0

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.

Edited by niths: n/a

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by diafol
0

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"];
            }
        }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.