PDA

View Full Version : Resolved output array



bluewalrus
10-20-2009, 07:30 PM
Can anyone see what's wrong with my $s_list/$f_list variables? I want to hold all of the file names in $s_list if they successfully uploaded or $f_list if they didn't. Currently all the files are uploading but the names are not displaying.

The full output of this is:

3 files uploaded successfully.
Array ( [0] => Array
[1] => ArrayArray
[2] => ArrayArray
)




$allfiles = $_POST['incriment'];
$uploaddir = $_COOKIE['ID'] . "/";
if (file_exists($_COOKIE['ID'])===true) {
//Directory is already created being upload process
for ($a=0; $a < $allfiles; $a++) {
if($_FILES['file']['name'][$a]) {
$uploadfile = $uploaddir . basename($_FILES['file']['name'][$a]);
$ext = strtolower(substr($uploadfile,strlen($uploadfile)-3,3));
if (move_uploaded_file($_FILES['file']['tmp_name'][$a], $uploadfile))
{
$success++;
$s_list[$a] = $s_list . $_FILES["file"] . "<br />";
}
else
{
$fail++;
$f_list = $f_list . $_FILES['file'] . "<br />";
}
}
}
if (isset($success)) {
echo "$success files uploaded successfully.<br />";
print_r($s_list);
}
if (isset($fail)) {
echo "$fail files failed to upload.";
print_r($f_list);
}

If anyone also sees why this chokes out Safari but not Firefox that'd be very helpful also. Thanks.