Can someone spot a mistake with move_uploaded_file()

I am trying to move an array of files. The file names are successfully input into database, but the files are not moved to new directory. Do I need to ad to anything? Thanks.

foreach ($_FILES['image']['name'] as $number => $file['name']) {
	
    $filenm[] = str_replace(' ', '_', $file['name']);
	
	$udfilenm = $_FILES['image']['tmp_name'][$number];
	
	move_uploaded_file($udfilenm, UPLOAD_DIR . $filenm);
	
}

Thanks. That worked.

Remove [‘name’] from $file[‘name’] in both instances, and from $filenm = and you should be fine :slight_smile: