I want about it a slightly different way instead:
$file_dir = "../images/equipment";
foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
if ($value) {
$imgname = "$report_id.$file_array[name]";
if (is_uploaded_file( $file_array['tmp_name'] )) {
move_uploaded_file( $file_array['tmp_name'], "$file_dir/$imgname") or die ("Couldn't copy");
}
}
}
I'll add type validation as well.
Thanks for your help. I'd like to add that this is one of the best forums I've ever used. So much info at our fingertips. Take care.😃