Multi File upload form with thumbnail maker not working
Posted: Mon Feb 20, 2012 1:15 am
Here is my code, it is not getting past file verification:
if ((($_FILES['multifile']['type'][$key] == "image/png") || ($_FILES['multifile']['type'][$key] == "image/jpeg") || ($_FILES['multifile']['type'][$key] == "image/pjpeg")) && ($_FILES['multifile']['size'][$key] < 2097152)) { if(count($_FILES['multifile']['name']) > 0) { foreach ($_FILES['multifile']['name'] as $key => $filename) { $filename = time().'_'.$_FILES['multifile']['name']; $source = $_FILES['multifile']['tmp_name']; $target = '/uploads/'.$filename; if(move_uploaded_file ($_FILES['multifile']['tmp_name'][$key],$target)) { createThumbnail($filename); // database insert here echo '<div class="success" style="margin-right:25px;">Images added, view individual album to edit image descriptions</div>'; } } } } else { echo '<div class="error">Invalid file, only jpg, jpeg, or png file types allowed</div>'; }the input type is file and the name is multifile[]. Any help would be great, thanks!