OK, the problem with your solution is that the FileReference complete event is of type flash.events.Event and does not have a data property and the target is the FileReference.
On Fri, Jun 20, 2008 at 2:11 PM, Tracy Spratt <[EMAIL PROTECTED]> wrote: > I just verified it, my handler is working as expected and I can access > the xml status node I am having the server return. > > Tracy > > > ------------------------------ > > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On > Behalf Of *Tracy Spratt > *Sent:* Friday, June 20, 2008 1:58 PM > > *To:* [email protected] > *Subject:* RE: [flexcoders] Re: Return data to FileReference > > > > Hmm, looks like I am just using the "Event.COMPLETE" event. Its been > awhile since I ran this code, let me double check it. > > Tracy > > > ------------------------------ > > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On > Behalf Of *Tracy Spratt > *Sent:* Friday, June 20, 2008 1:55 PM > *To:* [email protected] > *Subject:* RE: [flexcoders] Re: Return data to FileReference > > > > The event.result should contain whatever your server sends back, just like > with a normal httpservice request. Below is the code I am using. I send > back an xml status node, but you could send anything: > > Tracy > > > > *// Called on upload complete* > > *private* *function* onUploadComplete(event:DataEvent):*void* { > > *var* sData:String = event.data; > > *var* xmlStatus:XML = XML(sData); > > *if* ([EMAIL PROTECTED] == *"error"*) { > > *this*.height = 200; > > lbStatus.setStyle(*"color"*,*"red"*); > > lbStatus.text = *"Error Uploading File:"*; > > txtError.text = [EMAIL PROTECTED]; > > sCloseMode = *"ioerror"* > > *//_timerStatus.delay = 6000;* > > *//_timerStatus.start() * > > } > > *else* { > > _numCurrentUpload++; > > *if* (_numCurrentUpload < _aUploadFiles.length) { > > startUpload(*false*); > > } *else* { > > lbStatus.text = *"Upload successful"*; > > sCloseMode = *"success"* > > _timerStatus.start() > > } > > saveProjDoc(); > > } > > }*//onUploadComplete* > > > ------------------------------ > > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On > Behalf Of *Rich Tretola > *Sent:* Friday, June 20, 2008 1:16 PM > *To:* [email protected] > *Subject:* Re: [flexcoders] Re: Return data to FileReference > > > > Yes, but that file name is the name that was selected by the user, not the > one that the file was actually renamed to by the servlet. > > > > > On Fri, Jun 20, 2008 at 1:18 PM, Tracy Spratt <[EMAIL PROTECTED]> > wrote: > > You can get the event.result data in a handler for the uploadCompleteData > event. > > > > > http://livedocs.adobe.com/flex/201/langref/flash/net/FileReference.html#event:uploadCompleteData > > > > Tracy > > > ------------------------------ > > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On > Behalf Of *Rich Tretola > *Sent:* Friday, June 20, 2008 1:01 PM > *To:* [email protected] > *Subject:* [flexcoders] Re: Return data to FileReference > > > > I guess no one else has run into this before? > > > > On Fri, Jun 20, 2008 at 11:03 AM, Rich Tretola <[EMAIL PROTECTED]> > wrote: > > Here is the situation: > > I am uploading files from Flex to a Servlet using the FileReferenceList > class. Since there is no way to change the filename before it is uploaded, I > am passing along a parameter which holds the file name I would like the file > to ultimately be saved as. > > On the server side, all is well. The file is uploaded and then renamed to > my parameter name. > > So my question is, is there a way to pass the new filename back to Flex so > that I can access it within the FileReference Event.COMPLETE event listener? > > Rich > > > > > > >

