Here i have the problem with uploading image in php. The problem is that when first time i upload the image file it works fine. But when i am trying to upload the file second time without page refresh it takes first image name and upload it. Anybody can tell me what the problem and how can it resolve ? $name = $_FILES['ImageFile']['name']; $size = $_FILES['ImageFile']['size']; $tmp = $_FILES['ImageFile']['tmp_name']; $path = "public/www/uploads/"; $valid_formats = array("jpg", "png", "gif", "bmp"); $response = ''; if(strlen($name)) { list($txt, $ext) = explode(".", $name); if(in_array($ext,$valid_formats)) { if($size<(1024*1024)) { $actual_image_name = time().substr(str_replace(" ", "_", $txt), 5).".".$ext; if(move_uploaded_file($t...