The task is as follows: The user has the opportunity to upload several image files on the site, the download is performed without reloading the page, during the download a progressbar appears for each image separately when the images are downloaded, thumbnails of images are returned from the server and located below each progressbar. One progressbar is now implemented for all uploaded files, can you please tell how you can implement for each file separately? html:
<form id="formUploadFiles" enctype="multipart/form-data" action="ajax/UploadFiles" method="POST">
js:
var bar = $('.progressbar'); var percent = $('.percent'); var status = $('#status'); // Ajax загрузка изображений $('#formUploadFiles').ajaxForm({ beforeSend: function (xhr) { var inputFile = document.getElementById('upload1').files; var percentVal = '0%'; //bar.show(); bar.width(percentVal); percent.html(percentVal); }, uploadProgress: function (event, position, total, percentComplete) { var percentVal = percentComplete + '%'; bar.width(percentVal); }, success: function () { }, complete: function (xhr) { status.append(xhr.responseText); //bar.hide(); var percentVal = '100%'; bar.width(percentVal) percent.html(percentVal); $(".deletePhoto").unbind('click'); $(".deletePhoto").on('click', function () { deletePhoto($(this)) }) } });