I want to list each file that have been processed, in a DIV. Example: when file #1 has been processed, show the file name in the DIV. When file #2 has been processed, do the same thing but append it under file #1, and so on with each file.
jQuery
var request = $.ajax({
url: 'manage-images.php',
type: 'GET',
cache: false,
beforeSend: function() {
$('#photos').html('<div class="centered color-blue">Processing. Please wait...</div>');
}
});
request.done(function(s) {
$('#photos').append(s);
});
request.fail(function(s) {
$('#photos').html('Something went wrong!');
});
manage-images.php
$dir = new RecursiveDirectoryIterator('folder-name/here', FilesystemIterator::SKIP_DOTS);
$it = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::SELF_FIRST);
$it->setMaxDepth(1);
foreach($it AS $fileinfo) {
if($fileinfo->isFile()) {
// functions and stuff...
echo $fileinfo->getFilename().' - done<br>';
}
}