#90 Prefixing file names with the key

This commit is contained in:
Ken Fallon 2025-06-20 14:19:19 +02:00
parent 7cc2fcf479
commit 3b737fb286

View File

@ -361,7 +361,7 @@ it with the HPR Volunteer at admin@hackerpublicradio.org
foreach($_FILES["media_files"]["tmp_name"] as $key => $val) { foreach($_FILES["media_files"]["tmp_name"] as $key => $val) {
if ( $_FILES["media_files"]["error"][ "$key"] == 0 ) { if ( $_FILES["media_files"]["error"][ "$key"] == 0 ) {
$from = $_FILES["media_files"]["tmp_name"][ "$key"]; $from = $_FILES["media_files"]["tmp_name"][ "$key"];
$to = "${dir_structure}/" . $_FILES["media_files"]["name"][ "$key"] ; $to = "${dir_structure}/${db_key}_" . $_FILES["media_files"]["name"][ "$key"] ;
$moveResult = move_uploaded_file($from, $to); $moveResult = move_uploaded_file($from, $to);
if ($moveResult != true) { if ($moveResult != true) {
echo "ERROR: File not moved correctly >$from< >$to<"; echo "ERROR: File not moved correctly >$from< >$to<";