Jump to content

Just one undefined index in file upload array


CloudBreaker

Recommended Posts

All files are uploading fine...however, on line 8 for $error_array I get that "undefined index" notice.  Any ideas on how to get rid of it?

 

Thanks,

CB

<?php

	if(Isset($_FILES['file_array'])) {
		$name_array 	= $_FILES['file_array']['name'];
		$tmp_name_array = $_FILES['file_array']['tmp_name'];
		$type_array 	= $_FILES['file_array']['type'];
		$size_array	= $_FILES['file_array']['size'];
		$error_array 	= $_FILES['file']['error'];
		
		for($i = 0; $i < count($tmp_name_array); $i++){
			if(move_uploaded_file($tmp_name_array[$i], "test_uploads/".$name_array[$i])){
				echo $name_array[$i]." upload is complete<br>";
			} else {
				echo "move_uploaded_file function failed for ".$name_array[$i]."<br>";
			}			
		}		
	}
	
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.