Reputation: 157
I am running this code which is working fine for small size of images upto 2.5mb each image and the form have to take maximum of 8 imgaes but when I used to get the images more than 4mb more that 1 in the form it sends blank
$_POST
and
$_FILES
while if i select only one file of 6mb its uploading fine, But when I upload the multiple files then it sends me blank data at server side.
The form contains 8 input fields of file type [Not multiple ones]
$('#'+Id+'_form').submit(function(e){
var formObj = $(this);
var formURL = formObj.attr("action");
var formData = new FormData(this);
$.ajax({
url: formURL,
type: 'POST',
data: formData,
mimeType:"multipart/form-data",
contentType: false,
cache: false,
processData:false,
success: function(data, textStatus, jqXHR)
{
if(data){
data = jQuery.parseJSON( data );
for (var key in data) {
if (data.hasOwnProperty(key)) {
var html = '<span>Uploaded</span>';
// $('#'+data[key].upload+'_id').hide();
$('#'+data[key].upload+'_id').after(html);
}
}
$('#'+Id+'_uploadButton').val('Uploaded Successfully');
}else{
$('#'+Id+'_uploadButton').val('Error Occurred !!!');
}
},
error: function(jqXHR, textStatus, errorThrown)
{
}
});
e.preventDefault(); //Prevent Default action.
/*e.unbind();*/
});
$('#'+Id+'_form').submit();
Upvotes: 0
Views: 842
Reputation: 1282
This may be because of the default request length allowed by your server. Try setting it in the php.ini
as follows:
; Maximum allowed size for uploaded files.
upload_max_filesize = 40M
; Must be greater than or equal to upload_max_filesize
post_max_size = 40M
Upvotes: 1
Reputation: 3434
Try this in your php.ini
Or try it in your htaccess
:
Upvotes: 1