A question on the ui.uploader…
In my cgi script I am doing a validation of the file once it is received on the server.
If it is okay, I send back {“status”: “server”} along with some other parameters I have added. I can read these back web client as documented. It works well.
However, if it fails my validation and I send back {“status”: “error”} with the passed parameters, the parameters are undefined back on the web client. I need these passed parameters to display the proper message to the end user to explain the details of the failure.
I could just send back a good response of “server” and in my parameters have a data pair where I track if it fails validation, and then use that on the client for my processing logic, this is fine except that I would like to display the built in error icon (the triangle with “!”) if it fails my server validation. I don’t want the users to see a green check mark if I consider the file to be bad (even though it uploaded okay).
I think to accomplish this I either need the added parameters to be available on an “error” response or I am hoping there may be a way I can manually set the error Icon on a good “server” response (if my added parameters include a fail message).
Is there a method that I can call to change the green check mark to the failed icon? Or is there a way to read the extra parameters passed by the server script on a “error” response?
I hope what I am asking makes sense.
Thanks in advance.