in your controller put there
public function postUpload(){
$files = Input::file('files');
$json = array(
'files' => array()
);
foreach( $files as $file ):
$filename = $file->getClientOriginalName().".".$file->getClientOriginalExtension();
$json['files'][] = array(
'name' => $filename,
'size' => $file->getSize(),
'type' => $file->getMimeType(),
'url' => '/uploads/files/'.$filename,
'deleteType' => 'DELETE',
'deleteUrl' => self::$route.'/deleteFile/'.$filename,
);
$upload = $file->move( public_path().'/uploads/files', $filename );
endforeach;
return Response::json($json);
}
And replace your upload route
var initFileupload = function () {
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: '{{$route}}/upload',
autoUpload: true,
success: function(data){
console.log(data);
}
});
// Upload server status check for browsers with CORS support:
if ($.support.cors) {
$.ajax({
url: '{{$route}}/upload',
type: 'HEAD'
}).fail(function () {
$('<span class="alert alert-error"/>')
.text('Upload server currently unavailable - ' +
new Date())
.appendTo('#fileupload');
});
}
}