PHP multiple image uploads problem

I am trying to upload 4 images from a form using code below. All images upload and output fine apart from the last one which always has added code at the end of the image for example, image4.jpg%3E. As you can see the %3E is always being added… not sure why…? any ideas?

$product_image=$_FILES['product_image'];
		
		
		$product_image2 = $_FILES['product_image2'];
		
		$product_image3 = $_FILES['product_image3'];
		
		$product_image4 = $_FILES['img_product_now'];



		if (is_uploaded_file($product_image['tmp_name'])&& ($product_image2['tmp_name'])){



			$filename=$product_id;
			
			$filename2=$product_id.'_2';

			$images = uploadPImage($product_image, $imgpath, $filename);
			
			$images2 = uploadProductImage($product_image2, $imgpath, $filename2);

			

		}

		if (is_uploaded_file($product_image4['tmp_name'])&& ($product_image4['tmp_name'])){


			$filename3 = $product_id.'_3';
			
			$filename4 = $product_id.'_4';
			
			$data = uploadPImage ($product_image3, $imgpath, $filename3);
			
			$data2 = uploadPImage ($product_image4, $imgpath, $filename4);
			

		}

No I can’t see :slight_smile:

Try adding some var_dumps/echoes to check the values of your variables, maybe you’ll see where that %3E comes from.

And I don’t understand your IF’s? Don’t you want to check is_uploaded_file for images 1 and 2 in the first IF, and for images 3 and 4 in the second IF ?

Have you checked your form code to make sure you havent stuck an extra > in somewhere? (> being %3E in URLEncode)