Hello, I want a form uploads some files to the server but I want it is transparent for user. I have a input tag outside the form which is cloned to the form with cloneNode() [Javascript] every time the user changes its value. The name of the input tag is "files[]". Mozilla Firefox clones the input correctly but IE doesn't copy its value and with IE the inputs inside the form are empty. How can I copy the input field correctly with IE?
A piece of code:
In the Javascript function called when input.onChange:
InputCopy = InputParent.childNodes[i].cloneNode(true);
document.getElementById('divFromForm').appendChild(InputCopy);
The HTML input tag: <input type="file" id="archivoAnadir" name="files[]" onChange="anadir(this.value)">
The PHP request:
foreach ($_FILES["files"]["name"] as $key => $file) {
$query = "...";
mysql_query($consulta) or die("...");
if (!is_uploaded_file( $_FILES["files"]["tmp_name"][$key] )) die("...");
if (!move_uploaded_file($_FILES["files"]["tmp_name"][$key], "media/" . $file)) die ("..." . $file);
}
Thanks.