Php Uploaded image show Blank/Grey Color
<p>After Successfully transfer the uploaded image to my another website directory using php ftp code It's sometime show Grey Color image, Sometime it's show error message. I don't understand why it doesn't show my uploaded image. </p>

<p><strong>Php code:</strong></p>

<pre><code>if($image["name"] != "")
{
//$path = PATH . DS . "uploads" . DS . "products" . DS . $id;
$path = "../../uploads" . DS . "products" . DS . $id;

$path2 = "img";

if(!is_dir($path))
{
mkdir($path);
}
echo $uploadImage;
chmod($path, 0755);                 
/chmod($path2, 0755);                   

move_uploaded_file($image["tmp_name"], $path . DS . 
$uploadImage);//exit;                       

copy($path . DS . $uploadImage, $uploadImage);  

        }
</code></pre>

<p><strong>Php ftp image file transfer code:</strong>           </p>

<pre><code>$file = $path . DS . $uploadImage;
$remote_file = $uploadImage;

$ftp_server = "ftpserver";
$ftp_user_name = "username";
$ftp_user_pass = "password";
// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// upload a file
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
echo "successfully uploaded $file\n";
//ftp_chmod($conn_id,"0604","www.maaks.fr/gastronoome/recipemedia");
ftp_chmod($conn_id,"0604",$remote_file);
} else {
echo "There was a problem while uploading $file\n";
}

// close the connection
 ftp_close($conn_id);
</code></pre>

<p>Can you help me plz ?</p>
