gooloo wrote:
if i upload several files at the same time using an array e.g.($userfile[]),
how can i get the real name of those files that i just uploaded?
I tried $userfile_name[], it didn't work though!!
Any help please!!
The info about the files are in $HTTP_POST_FILES
varible.
It's an array.
Look at the code below:
<?php
if (isset($userfile)){ // files are submited
echo "<BR>".$HTTP_POST_FILES[userfile][name][0];
echo "<BR>".$HTTP_POST_FILES[userfile][type][0]
echo "<BR>".$HTTP_POST_FILES[userfile][tmp_name][0];
echo "<BR>".$HTTP_POST_FILES[userfile][size][0];
echo "<HR>";
echo "<BR>".$HTTP_POST_FILES[userfile][name][1];
echo "<BR>".$HTTP_POST_FILES[userfile][type][1];
echo "<BR>".$HTTP_POST_FILES[userfile][tmp_name][1];
echo "<BR>".$HTTP_POST_FILES[userfile][size][1];
}else{ // print the FORM
?>
<FORM METHOD=POST ENCTYPE="multipart/form-data">
<BR><INPUT TYPE=FILE NAME="userfile[]">
<BR><INPUT TYPE=FILE NAME="userfile[]">
<BR><INPUT TYPE=SUBMIT>
</FORM>
<?php
}
?>