After long time of searching the best upload technique I've decided to go with jQuery Uploadify.
I got no problem implementing it into existing code, excluding one thing. I created strict upload validation rules.
The main problem is that onAllComplete() function returns success message. In my validation file I tried to use echo 'errror'
and die('error')
as well. Without any luck. I've searched Google and SO. Without any luck.
Do you have any ideas/advices/snippets? Any help appreciated.
Update
To make my situation clear. I'm using onComplete() function to show eventual but I have no
idea how to force onAllComplete() function to show correct data.
Update 2 I applied IgalSt (I'm sure I did something similar before) but still having the same issue. My onComplete function looks as following now:
onComplete: function (ev, queueID, fileObj, response) {
var result = $.parseJSON(response).success;
alert(result);
if (result == false) {
alert('invalid')
} else {
alert('everything is OK');
var size = Math.round(c.size/1024);
}
return false;
},
If I alert(response) it alerts
false` so it should be working. Any suggestions why it's not? onAllComplete() function still shows this file as uploaded successfully.
Regards, Tom