You should add sequence upload to upload files one by one, sending ajax request with loop will simply crash browser, for example I've uploaded 500 files that will open 500 ajax request thread and simply browser can stop responding, why don't you add sequence upload that upload file as limit e.g upload as 2 by 2, or 1 by 1, or 5 by 5 and give control to person to set this value.
You should add sequence upload to upload files one by one, sending ajax request with loop will simply crash browser, for example I've uploaded 500 files that will open 500 ajax request thread and simply browser can stop responding, why don't you add sequence upload that upload file as limit e.g upload as 2 by 2, or 1 by 1, or 5 by 5 and give control to person to set this value.