I don't know why I thought that checking if the error code was equal to 4 would help me because it doesn't. I tried the mentioned solution but it still doesn't seem to be working. Am I missing something?
if(($_FILES['attachment']['error'] == 0) && !empty($_FILES['attachment']['size']))
{
got file
}
else
{
no file
}
This is my form code
<form id="addAttachment" name="addAttachment" method="post" action="add_attachment.php">
<input type="file" id="attachment" name="attachment" size="38" />
<input type="submit" value="Add" />
</form>
I can't upload the file because it always executes the else part of he script. Any suggestions?