-1

I have this input

<form action="<?=isset($_GET['tree'])?'edit.php':'save.php'?>" method="post" enctype="multipart/form-data" id="<?=isset($_GET['tree'])?'edit-form':'csv-form'?>">
 ....
 .....
<input type="file" name="doc" id="doc" multiple>

I'm trying to handle the uploaded files but with

var_dump($_FILES);

$_FILES only contains the last selected file.

Afs_im
  • 43
  • 2
  • 6

2 Answers2

1

use the name tag with square brackets: <input type="file" name="doc[]" id="doc" multiple>

heXer
  • 304
  • 1
  • 10
0

Use like this.

<input type="file" id="doc" name="doc[]" multiple>
Naushil Jain
  • 434
  • 3
  • 11