So I've been struggling with this for the past few hours and couldn't find a working solution anywhere.
I've made a multiple file uploader in my website. For a long time it worked well or at least I thought it does. Recently I tryed uploading 3 images (total size 16MB) and at some point it displays this in console:
Failed to load resource: net::ERR_CONNECTION_RESET
This is my upload source:
$("#submitform").click(function() {
var h = document.getElementById("filelist");
if (h.files.length < 1)
return;
$("#state").css("display", "block");
var xhr = new XMLHttpRequest()
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
$("#state").css("display", "none");
if (xhr.responseText == "")
alert("Files uploaded sucessfully.");
else
alert("Failed to upload files: \n" + xhr.responseText);
location.reload();
}
};
xhr.upload.addEventListener("progress", function(e) {
var pc = parseInt(e.loaded / e.total * 100);
$("#precentage").html(pc + "%");
}, false);
xhr.open("POST", "uploadImages.php", true);
var data = new FormData();
var j = 0;
for (i = 0; i < h.files.length; i++) {
if ($('#use' + i).val() == 1) {
data.append("image" + j, h.files[i]);
j++;
}
}
xhr.send(data);
});
and uploadImages.php does some basic algorithms that work whenever I try to upload a single image.
My php.ini looks like this:
file_uploads = On
post_max_size = 500M
upload_max_filesize = 500M
curl.cainfo = "/home/accountname/php/cacert.pem"
I've tryed adding cacert.pem but it doesn't fix anything. I'm using godaddy's linux starter pack to host my website, if that matters.