MANUAL MULTIPLE FILE UPLOAD TEST

This page is for manual testing of file-upload, specifically to test file-input element with the multiple-attribute set. Selenium doesn't support testing with the multiple-attribute.

However, automated Selenium test cases do test multiple file upload where there are multiple file-input elements within the same form (testing of this is supported by Selenium).




$uploader_root
".PHP_EOL; } else { echo "Created: $uploader_root
".PHP_EOL; } } while (1) { $tgt_dir = sprintf("%s/upload-%03d", $uploader_root, $uploader_serial_number); if (!file_exists($tgt_dir)) { break; } $uploader_serial_number += 1; } echo "

Uploaded files will be saved under: $tgt_dir (with their original names).

".PHP_EOL; if ($_SERVER["REQUEST_METHOD"] == "POST") { echo "
".PHP_EOL; echo "

UPLOAD RESULTS:

".PHP_EOL; if (!mkdir($tgt_dir)) { echo "FAILED TO mkdir: " . $tgt_dir . "
".PHP_EOL; } $total_fields = count($_FILES); $field_number = 0; $total_uploads = 0; $upload_number = 0; if ($total_fields > 0) { foreach ($_FILES as $field_name => $info) { $total_uploads += count($_FILES[$field_name]['name']); } echo '

TOTAL: ' + $total_uploads + ' uploads'; echo ' - divided among: ' . $total_fields . ' fields

'.PHP_EOL; echo '

    '.PHP_EOL; foreach ($_FILES as $field_name => $info) { $num_sub_uploads = count($_FILES[$field_name]['name']); $field_number += 1; for ($i = 0; $i < $num_sub_uploads; $i++) { $upload_number += 1; $iname = $info['name'][$i]; $itype = $info['type'][$i]; $itmp_name = $info['tmp_name'][$i]; $ierror = $info['error'][$i]; $isize = $info['size'][$i]; echo "
  1. Upload# $upload_number / $total_uploads | "; echo "" . $field_name . "[" . $i . "]:".PHP_EOL; if ($ierror > 0) { echo " - ERROR LOADING: $ierror
    ".PHP_EOL; } else { $len = filesize($itmp_name); $md5_digest = md5_file($itmp_name); $target = $tgt_dir . "/" . $iname; echo "".PHP_EOL; } echo '
  2. '.PHP_EOL; } } echo '

'.PHP_EOL; } echo "

".PHP_EOL; echo "End-Of-Results".PHP_EOL; echo "

".PHP_EOL; } ?>