jQuery Form Plugin with file upload: succes callback not triggered

jQuery Form Plugin with file upload: succes callback not triggered

I'm using the jQuery Form Plugin in a Java application to upload a file. This works fine for the most part: my form gets submitted and the proper servlet executed, allowing me to save the form data including the uploaded file. I'm struggling with the after submit handling though.

If I understand it correctly, in case of a file upload I must wrap my json response in an html <textarea>. What I don't grasp, is how to proceed from there. How do I obtain the response in my js script and handle it there? Preferably I would like my "success" callback to handle both situations, but as it's not called in case of the iframe work around, I need another way to determine if the ajax request was successful and handle the response.

Some advice is highly appreciated.