you need to use FormData()
Ex-
var id = $('#id').val();
var image = $('#image')[0].files[0];
new form = new FormData();
form.append('id', id);
form.append('image', image);
$.ajax({
url: 'upload',
data: form,
cache: false,
contentType: false,
processData: false,
type: 'POST',
success:function(response) {
alert(response);
}
});
Use this code according to your requirements and it will send files to your controller;
In controller,
$id = \Input::get('id);
$image = \Input::file('image');
Boooooooooom...