How can I trigger the error event in DropZone using PHP?

, however I can not find any documentation on how to trigger this from PHP.

I have tried sending various header() responses from PHP including, 404, 500, 503, and so on yet this event has not fired.

What I am looking to do, is the server checks the mime to see if it is valid, and if it is not valid, I discard the file, and ideally -- return an error so that dropzone can respond accordingly.

From the javascript side, I have tried the following :

.on("complete", function(file,response) {
console.log(response);
}

.on("error", function(file,response) {
console.log(response);
}

.on("success", function(file,response) {
console.log(response);
}

... however,

response

is undefined, even if i return JSON or plain text from the php script. It doesn't appear that dropzone.js supports getting the full server response or at least it doesn't elevate it to the custom handler. The ONLY place I have seen any reference to passing a second param on events is here on SO in other questions that are not directly asking this question.

There must be a way to get the server response (as I have done in the past with other uploader javascript such as jQuery POST, and jqUpload, and so on). It seems rather silly that I can't trigger a command to signal the upload failed -- even if the file transfer completed -- as it still needs to wait on the script for a response. --- This means I am likely overlooking something, which is why I am calling for assistance as their documentation reveals absolutely nothing with regards to how a server should respond --- language irrelevant, however in my case, I am using PHP.