retrieved upload images in php
- by hunter
i want to retrieve image from client (ipod) programmed in objective c i use the following code
$TARGET_PATH = "pics/";
$image = $_FILES['photo'];
$TARGET_PATH =$TARGET_PATH . basename( $_FILES['photo']['name']);
$TARGET_PATH =$TARGET_PATH.".jpg";
if(file_exists($TARGET_PATH))
{
$TARGET_PATH =$TARGET_PATH .uniqid() . ".jpg";
}
if (move_uploaded_file($image['tmp_name'], $TARGET_PATH))
{
$TARGET_PATH="http://www.".$_SERVER["SERVER_NAME"]."/abc/".$TARGET_PATH;
echo $TARGET_PATH;
echo "image upload successfully";}
else{
echo "could not upload image";
}
this code upload five to six images successfully and after that it gives me error i.e
Notice: Undefined index: photo in /home/abc/public_html/abc.com/fish/mycatch_post.php on line 42
Notice: Undefined index: photo in /home/abc/public_html/abc.com/fish/mycatch_post.php on line 53
could not upload image