Here is my code, it is not getting past file verification:
[syntax=php]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>';
}[/syntax]
the input type is file and the name is multifile[]. Any help would be great, thanks!
Multi File upload form with thumbnail maker not working
Re: Multi File upload form with thumbnail maker not working
Well you might want to have a bit of a re-think since $_FILES['multifile']['type'] can very easily be faked by somone looking to upload a php script.
Other than that, what do you mean by the file validatoion ? do you always get the "invalid file" message ?
Other than that, what do you mean by the file validatoion ? do you always get the "invalid file" message ?