0

Unable to send more than five binary file to controller.

Getting Files by Id
var one= $("#one").get(0).files;
var two= $('#two').get(0).files;
var three= $('#three').get(0).files;
var four= $('#four').get(0).files;
var five= $('#five').get(0).files;
var six= $('#six').get(0).files;

//Appending in Form Data
var ObjEntity = new FormData();
ObjEntity.append("Id", 1);

//Registration
ObjEntity.append("Title", $('#Title').val());
ObjEntity.append("City", $('#City').val());

//Regulatory Documents
ObjEntity.append("one", one[0]);
ObjEntity.append("two", two[0]);
ObjEntity.append("three", three[0]);
ObjEntity.append("four", four[0]);
ObjEntity.append("five", five[0]);
ObjEntity.append("six", six[0]);


Calling Ajax
$.ajax({
    type: 'POST',
    url: urlPath,
    data: ObjEntity,
    cache: false,
    contentType: false,
    processData: false,
    success: function (response) {
        alertify.alert('success');
    },
    error: function (request, status, error) {
        alertify.alert('error');
    }
});

I am unable to send all six at a time but if I pass any of five it is being sent to controller. Kindly help.

0 Answers0