I'm having trouble sending a MultipartRequest in iOS that contains images. If the post contains only text arguments, the request is received on my server with no problems. This works flawlessly when built for Android, but it seems that the request.addData() function might be causing trouble on my iPhone.
Sample code:
...
MultipartRequest request = new MultipartRequest();
request.setURL( ServerURL );
request.setPost( true );
request.addArgumentNoEncoding( "test", "blah" );
Image image = Image.createImage( FileSystemStorage.getInstance().openInputStream( pathToImageFile ) );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.getImageIO().save( image, baos, FORMAT_PNG, 1.0f );
request.addData( arg, baos.toByteArray(), "image/png" );
request.setFilename( arg, filename );
NetworkManager.getInstance().addToQueueAndWait( request );
...
Just to illustrate what I'm trying to do. Submission hangs for a long time and then seems satisfied, but _POST contains no information on the server side. Again, this works perfectly on an Android device and does work in iOS if the request contains String args, but no images (binary data). Is there anything that I'm missing out? Any iOS quirks that might be presenting themselves?
Thanks