It killed me, but I found a way. In the uploadify.php file, I created all my validation. The difference here is that I set HTTP 4xx codes for each type of error.
if (! in_array($fileParts['extension'], $typesArray)) { header("HTTP/1.1 405");
This returns the error "405" to uploadify.js.
In the file, I set $ ("# fileInput"). uploadify () I added the onError function.
'onError' : function(event, ID, fileObj, errorObj) { var r = "<br />ERROR: "; switch(errorObj.info) { case 405: r += "Invalid file type."; break; case 406: r += "Some other error."; break; } setTimeout('$("#fileInput'+ ID + 'span.percentage").html("'+r+'");',111); }
This makes the uploadify default function exist while it expands.
Hope this help!
source share