I'm using the Upload extension to upload an image, pretty straighforward. On the server I give the image file my own custom name (a guid) and then save it to server storage. Great so far, this all works fine. However what I would like to do is pass this new image url back to the client on the success event. The problem is that from what I've seen so far, returning anything other than an empty string is interpreted by the upload control on the client as an error and is routed to the "onError" handler.
Is there a way that I can pass this state back to the client and still handle it in the "onSuccess" event? Basically I want to give this path to another control on my page so that it can refresh itself with the new URL. The only other ways I can think to make this happen is to:
Handle "onError" and fudge it to also handle a success by looking at what was returned. (pretty stinky)
Have the second control perform an ajax postback "onSuccess" and reload it's own state from the server, but of course this would add an extra postback for each upload that happens. Was hoping to avoid this if possible.
Any ideas are appreciated, thanks!
Eric
Is there a way that I can pass this state back to the client and still handle it in the "onSuccess" event? Basically I want to give this path to another control on my page so that it can refresh itself with the new URL. The only other ways I can think to make this happen is to:
Handle "onError" and fudge it to also handle a success by looking at what was returned. (pretty stinky)
Have the second control perform an ajax postback "onSuccess" and reload it's own state from the server, but of course this would add an extra postback for each upload that happens. Was hoping to avoid this if possible.
Any ideas are appreciated, thanks!
Eric