Skip to main content
January 23, 2012
Question

Truncated response on DataEvent.UPLOAD_COMPLETE_DATA

  • January 23, 2012
  • 1 reply
  • 1128 views

Hello,

We are developing an mobile AIR application, using the Flex 4.6 SDK, which uploads a file to a server and then relies on getting some information (the upload’s ID) from the server’s response.

It all works fine when running through the AIR simulator, but when we run the app on an iPhone or an iPad, the server’s response after the upload has finished seems truncated.

We weren’t sure where the response might get truncated, so we tried Wireshark to compare the packets that come back from the server for a “good” and for a truncated response and they seem to be exactly the same in size.

This is an example code of what we’re trying to do:

public function uploadFileToServer( _filePath : String ) : void
{
          var file : File = new File( _filePath );
 
          var requestText : String = “...”;
          var request : URLRequest = new URLRequest( requestText );
          request.method = URLRequestMethod.POST;
          request.contentType = "multipart/form-data";
 

file.addEventListener( DataEvent.UPLOAD_COMPLETE_DATA, handleFileUploadComplete );

 
          file.upload( request, "File1" );
}

in handleFileUploadComplete is where the DataEvent’s data is truncated on a mobile device, but not when the application runs through the simulator.
The “good” response isn’t large and is no more than 130 symbols. On a mobile device it always gets truncated to 48 symbols.

Assuming that the server sends exactly the same response each time (or so it seems when looking at the communication with Wireshark), is there a way to track what happens to it between its arrival and what comes in on the DataEvent.UPLOAD_COMPLETE_DATA event?

Thank you in advance.

DiaDraw.com

This topic has been closed for replies.

1 reply

Participating Frequently
January 23, 2012

Hi,

Have you made sure that the file is indeed getting uploaded from iPhone/iPad? Are you listening for any error events? If not already doing it, please add listeners for securityError, httpStatus, httpResponseStatus and ioError. If you are not receiving any of these and still see the problem, could you please file a bug report at http://bugbase.adobe.com? Please attach a sample application and its sources which can demonstrate the issue.

Thanks,

Sanika

January 23, 2012

Hi Sanika and thank you for responding so quickly!

I should have provided these answers in my initial question - thanks for the reminder:

1. The file does get uploaded successfully to the server every time (including when running the app on the iPhone and the iPad).

2. There are listeners in the code to the rest of the events (securityError, httpStatus, httpResponseStatus and ioError) - I omitted them from the example to avoid clutter.

3. None of the error events fire.

I'll bundle an application for reproducing the problem and will file a bug report.

Thank you,

DiaDraw.com

January 24, 2012

Submitted Adobe AIR 3.0  -  Bug 3096525 with a test application attached to reproduce the problem.

Best regards,

DiaDraw.com