when upload files, I make something like 'preview'. It stores form variables as
for(i=0;i<count($UpFile);i++){ //loop
<input name="Files[',htmlspecialchars($UpFile_name[$i]),'][FileName]" type="text" value="',htmlspecialchars($UpFile_name[$i]),'">
<input name="Files[',htmlspecialchars($UpFile_name[$i]),'][FileSize]" type="text" value="',htmlspecialchars($UpFile_size[$i]),'">
and then after submittting, when $Files
is array I work with saved files, using their names as variables names.
The issue is, when I upload file with the name file[123].jpg
, then php look at it not as $Files['file[123].jpg']
, but as $Files[$file[123].jpg']
. In other words, form record not found.
How to store names for form inputs to preserve square brackets, if there're ones in filenames?