Reputation: 12957
I'm using Dropzone for multiple image uploads. If I get a server error that returns "Whoops, there's been an issue" the on-hover error message for that ajax upload flips out and tries to display the html for the entire page. What I need is for that page to return a json message instead. Is there a way for me to catch any errors that occur on upload failure?
Upvotes: 0
Views: 85
Reputation: 1643
you have to include the CSRF token. Normal jquery ajax can have this appended to header on body request parameter
$.ajax({
type: "POST",
url: "file",
data: {
_token: $('input[name="_token"]').val()
}
}).done(function( msg ) {
console.log( msg );
});
Upvotes: 1