I'm trying to upload files to my server but it doesn't work at all. Here is test code:
<?php
echo count($_FILES['upload']['name']);
?>
<!DOCTYPE html>
<html>
<body>
<form action="" method="POST" enctype="multipart/form-data">
<input name="upload[]" type="file" accept=".mp3" multiple="multiple" />
<br>
<input type="submit" value="Upload">
</form>
</body>
</html>
It always prints 0, file upload is enabled on my server.
echo count($_FILES['upload'])you'll obtain the correct result. It will be an array of elements with only one element. As @Jeremy suggest, remove the array[]notation to avoid send array instead of propper file (at least if you don't have to send multiple files at once)name="upload"