Dynamic generated file upload control<using javascript> doesn't post?
<p>Hai 
     I am  having a form which contains a filetype like this</p>

<pre><code>  &lt;tr&gt;&lt;td&gt; &lt;input name="ufile[]" type="file" id="ufile[]" size="50" /&gt;&lt;/td&gt;&lt;/tr&gt;
</code></pre>

<p>on submit i am calling a script</p>

<pre><code>function addRowToTable()
    {
        var tbl = document.getElementById('uploadTab');
        var lastrow = tbl.rows.length;
        var iteration = lastrow; 
        var row = tbl.insertRow(lastrow);

        var cell2 = row.insertCell(0);
        var e2 = document.createElement('input');
        e2.type = 'file';
        e2.name = 'ufile[]';
        e2.id = 'ufile[]';
        e2.size='50';
        cell2.appendChild(e2);
    }
</code></pre>

<p>This script generates The tr on a button click... In my view generatedsource tool i get the "" like this</p>

<pre><code>&lt;tr&gt;&lt;td&gt;&lt;input size="50" id="ufile[]" name="ufile[]" type="file"&gt;&lt;/td&gt;&lt;/tr&gt;
</code></pre>

<p>when i submit the form i dont get the file name for the generated file type in my view page 
But i get the file name foe the one that is default
What may be the problem? </p>

<p>I posting my form to this page,</p>

<pre><code>&lt;?php
//set where you want to store files
//in this example we keep file in folder upload
//$HTTP_POST_FILES['ufile']['name']; = upload file name
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif
$path1= "upload/".$HTTP_POST_FILES['ufile']['name'][0];
$path2= "upload/".$HTTP_POST_FILES['ufile']['name'][1];
$path3= "upload/".$HTTP_POST_FILES['ufile']['name'][2];
$path4= "upload/".$HTTP_POST_FILES['ufile']['name'][3];

//copy file to where you want to store file
copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
copy($HTTP_POST_FILES['ufile']['tmp_name'][1], $path2);
echo copy($HTTP_POST_FILES['ufile']['tmp_name'][2], $path3);

//$HTTP_POST_FILES['ufile']['name'] = file name
//$HTTP_POST_FILES['ufile']['size'] = file size
//$HTTP_POST_FILES['ufile']['type'] = type of file
echo "File Name :".$HTTP_POST_FILES['ufile']['name'][0]."&lt;BR/&gt;";
echo "File Size :".$HTTP_POST_FILES['ufile']['size'][0]."&lt;BR/&gt;";
echo "File Type :".$HTTP_POST_FILES['ufile']['type'][0]."&lt;BR/&gt;";
echo "&lt;img src=\"$path1\" width=\"150\" height=\"150\"&gt;";
echo "&lt;P&gt;";

echo "File Name :".$HTTP_POST_FILES['ufile']['name'][1]."&lt;BR/&gt;";
echo "File Size :".$HTTP_POST_FILES['ufile']['size'][1]."&lt;BR/&gt;";
echo "File Type :".$HTTP_POST_FILES['ufile']['type'][1]."&lt;BR/&gt;";
echo "&lt;img src=\"$path2\" width=\"150\" height=\"150\"&gt;";
echo "&lt;P&gt;";

echo "File Name :".$HTTP_POST_FILES['ufile']['name'][2]."&lt;BR/&gt;";
echo "File Size :".$HTTP_POST_FILES['ufile']['size'][2]."&lt;BR/&gt;";
echo "File Type :".$HTTP_POST_FILES['ufile']['type'][2]."&lt;BR/&gt;";
echo "&lt;img src=\"$path3\" width=\"150\" height=\"150\"&gt;";

///////////////////////////////////////////////////////

// Use this code to display the error or success.

$filesize1=$HTTP_POST_FILES['ufile']['size'][0];
$filesize2=$HTTP_POST_FILES['ufile']['size'][1];
$filesize3=$HTTP_POST_FILES['ufile']['size'][2];

if($filesize1 &amp;&amp; $filesize2 &amp;&amp; $filesize3 != 0)
{
echo "We have recieved your files";
}

else {
echo "ERROR.....";
}

//////////////////////////////////////////////

// What files that have a problem? (if found)

if($filesize1==0) {
echo "There're something error in your first file";
echo "&lt;BR /&gt;";
}

if($filesize2==0) {
echo "There're something error in your second file";
echo "&lt;BR /&gt;";
}

if($filesize3==0) {
echo "There're something error in your third file";
echo "&lt;BR /&gt;";
}

?&gt;
</code></pre>

<p>edit 
This is my array</p>

<pre><code>Array ( [ufile] =&gt; Array ( [name] =&gt; Array ( [0] =&gt; stripe.jpg [1] =&gt; stripe.jpg ) [type] =&gt; Array ( [0] =&gt; image/jpeg [1] =&gt; image/jpeg ) [tmp_name] =&gt; Array ( [0] =&gt; D:\xampp\tmp\php29A9.tmp [1] =&gt; D:\xampp\tmp\php29AA.tmp ) [error] =&gt; Array ( [0] =&gt; 0 [1] =&gt; 0 ) [size] =&gt; Array ( [0] =&gt; 8717 [1] =&gt; 8717 ) ) ) 
</code></pre>
