tags:

views:

3532

answers:

1

Hi,

If the server returns an error (HTTP response code != 200) when uploading a file with Uploadify, the uploaded file gets a red background and a message is show like this:

file.jpg (52.78KB) - HTTP Error

indicating that there was a HTTP Error. But that's not very useful to the the user. How can I make it show a more detailed error message? Like: 'Not a valid image' or 'Quota full'?

I was thinking of passing those messages in the HTTP response body, but Uploadify doesn't pick them up. Is there a known way to pass error messages back to Uploadify?

+3  A: 
Gaby
There doesn't seem to be a way to get at the HTTP response body. Thus providing more useful error messages from the server into the output is useless, since you can't display them.
hopla
added a version that works for me..
Gaby
Ok, I see it now... Only onComplete has access to the response body. onError has not but that is where I have been looking, since I wanted to show extra information, you know, *in case of errors*. But apparently onComplete also fires for errors? Thus allowing us to get at the response body. Why the developer of Uploadify didn't just pass the response to the onError function as well is beyond me...
hopla
After trying it, onComplete does not seem to fire in case of error. So as far as I see now, there is no way to get at the http response body in case of error. And thus, the question still stands. Time to contact the Uploadify author and ask him why he doesn't provide onError with access to the http response body...
hopla