Use the plugin jQuery Upload. In the plugin files there is an example of an image upload class. However, it is very complex.
To get the data that this plugin send, you can use equal is specified in the manual.
When a form is sent, the arrays $_FILES['userfile']
, $_FILES['userfile']['name']
, and $_FILES['userfile']['size']
are initialized.
Suppose you upload the files review.html
and xwp.out
using the following form:
<form action="file-upload.php" method="post" enctype="multipart/form-data">
<input name="userfile[]" type="file" /><br />
<input name="userfile[]" type="file" /><br />
<input type="submit" value="Enviar" />
</form>
In this case in $_FILES['userfile']['name'][0]
will take the value review.html
and $_FILES['userfile']['name'][1]
will have xwp.out
.
The other file variables also have the same behavior
$_FILES['userfile']['size'][0]
$_FILES['userfile']['name'][0]
$_FILES['userfile']['tmp_name'][0]
$_FILES['userfile']['size'][0]
$_FILES['userfile']['type'][0]
Using this you can implement an upload class that suits you, and you can use the plugin I mentioned.
Another way that I believe is more feasible for you, is to send the zipped file.
You can read the compressed files using the ZipArchive
// Criando o objeto
$z = new ZipArchive();
// Abrindo o arquivo para leitura/escrita
$open = $z->open('teste.zip');
if ($open === true) {
// Listando os nomes dos elementos
for ($i = 0; $i < $z->numFiles; $i++) {
// Obtendo o conteúdo pelo indice do arquivo $i
$fileContent = $z->getFromIndex($i);
// Aqui você faz o parser do XML e realiza sua manipulação
}
// Fechando o arquivo
$z->close();
} else {
echo 'Erro: '.$open;
}
Learn more about Ziparchive
Outside the uploadify you tried some other plugin? has the jquery file upload
– rray