All this
Code:
$sourcefile = $_FILES['sourcefile']['tmp_name'][0];
$sourcefile_size = $_FILES['sourcefile']['size'][0];
$sourcefile_name = $_FILES['sourcefile']['name'][0];
$sourcefile_type = $_FILES['sourcefile']['type'][0];
$sourcefile = $_FILES['sourcefile']['tmp_name'][1];
$sourcefile_size = $_FILES['sourcefile']['size'][1];
$sourcefile_name = $_FILES['sourcefile']['name'][1];
$sourcefile_type = $_FILES['sourcefile']['type'][1];
$sourcefile = $_FILES['sourcefile']['tmp_name'][2];
$sourcefile_size = $_FILES['sourcefile']['size'][2];
$sourcefile_name = $_FILES['sourcefile']['name'][2];
$sourcefile_type = $_FILES['sourcefile']['type'][2];
$sourcefile = $_FILES['sourcefile']['tmp_name'][3];
$sourcefile_size = $_FILES['sourcefile']['size'][3];
$sourcefile_name = $_FILES['sourcefile']['name'][3];
$sourcefile_type = $_FILES['sourcefile']['type'][3];
is nonsense. You're just overwriting the variable with one array item after another, not copying the whole array to the variable.
In fact, I'm not so sure about putting square brackets in the names. I don't think this will cause it to work as you expect, creating an array. Try renaming the variables to something sensible.
Bookmarks