I have the following problem is that regardless of the error it only seens to return the value of $error==4?? there are multiple files being uploaded but i only want to retrn 1 message error 4 if no files have been uploaded and error 2 if a file is more than 204008b
foreach ($_FILES["fileatt"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK)
{
$fileatt = $_FILES['fileatt']['tmp_name'][$key];
$fileatt_type = $_FILES['fileatt']['type'][$key];
$fileatt_name = $_FILES['fileatt']['name'][$key];
}
if ($error==4)
{
$action="reply";
$sideaction="";
$error ="You did not upload any file attachment do you still wish to proceed?";
}
if (($error==2) || ($error==4))
{
$action="reply";
$sideaction="addattachments";
$error ="An error occured, you can only upload files with a maximum filesize of 200KB please try again";
}
}