0 Replies Latest reply on Mar 18, 2008 8:41 AM by dimpled

    FileReference UPLOAD_COMPLETE_DATA issue

      Here is the scenario: user is flex uploads file to server which is processed and returned. (Returned as XML). Now with a small return (4-5K) it works just fine. But as soon as you send more data, i get "cdata must be returned".. further investigation, it's not getting the whole file.

      What boggles my head, is that FileReference ultimately uses URLRequest which shouldn't be limited in size. So I am hoping to get some info.

      One theory i have is that the swf isn't waiting around to download the whole response. On my home development server (i use mamp) i don't get the problem (at least not often). But over the web I get it. I have tried different content-types (octet and text/xml) as well as supplying a content-length header. I'm out of ideas :(

      Here's a quick example:
      myFileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, onUploadDataComplete);
      public function onUploadDataComplete(event:DataEvent):void {
      var result:XML = new XML(event.data);

      Sample XML:
      about 10-30K worth of data

      edit: One additional note: event.data.length is always 2896, even with different file sizes. Files under this size work just fine. It's like flex isn't hanging around for the rest of the file. I'm sure the browser/server 'streams' the file in some regard...