PDA

View Full Version : flash.net.FileReference() (file upload) question


breeky5
09-28-2008, 05:55 PM
Hello everyone,

Is there a way to send a string response from server (I'm using java servlet) when uploading using fileReference object? For example, an exception has occurred while uploading, my program would send a custom error message through a servlet response and will be displayed in my laszlo app. Is that possible?



fileReference.upload(url);

<----- Exception ---->

<----- Send Custom Message ---->

<----- display msg -------->




Thanks.

rcyeager
09-28-2008, 06:54 PM
What I do is to send a unique transaction id on the file upload requestURL to my server-side JSP. The JSP does the file store and writes the status to the db w/ the transaction id.

When the client gets the onComplete event back from the Flash API, I then issue a request to the server to retrieve the status using the transaction id as the key.

Robert Yeager
http://www.qrowd.com
http://www.cooqy.com

breeky5
09-28-2008, 09:16 PM
Thanks for the reply!

We'll i guess that's the only way to do it. I'll give it a try! Thanks again.