Deployed Applet Unable to Multipart Post

19 views
Skip to first unread message

Dan

unread,
Apr 13, 2011, 6:53:36 PM4/13/11
to AS3 HttpClient
Hi,

I put together an applet that posts image(s) using as3httpclientlib to
a
servlet. The applet works fine in (flash builder) debug mode. However,
once deployed, it appears the applet is not posting the multipart
data.

I don't understand why does the code works in debug mode but doesn't
when deployed to a server. Is security handled differently when it
comes to as3httpclientlib and multipart posts? Note: the target server
url is the same as the url from which the applet is served.

Anyone have any suggestions on how I can get to the root cause of the
problem?

Following is the relevant upload code:

private function uploadHandler(event:MouseEvent):void
{
var client:HttpClient = new HttpClient();
var uri:URI = new URI(...);
_uploadSize = _processedImages.length; // Set number of images to
upload.
_progressPopUp = PopUpManager.createPopUp(this,
com.myapp.ui.components.ProgressPopUp, true);

for (var i:int=0; i < _processedImages.length; i++)
{
++_count; // Increment count of images
var data:ByteArray = _processedImages[i];
data.position = 0;
var multipart:Multipart = new Multipart([
new Part("count", String(_count), "text/plain"), new
Part("image", data, "application/octet-stream", [{name:"filename",
value:
_imageFilesRef.fileList[i].name}])
]);
client.listener.onComplete = uploadCompleteHandler;
client.postMultipart(uri, multipart);
}
}
Reply all
Reply to author
Forward
0 new messages