Try not setting the contentType yourself and see what gets sent?  It probably will just be raw binary data that you have to interpret on your own?

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of bondbeer
Sent: Tuesday, August 15, 2006 4:11 PM
To: [email protected]
Subject: [flexcoders] Posting ByteArray with URLRequest...

 


Hi Guys,

I've seen this question posted previously with no answer given. In
the AS3 docs, it outlines that you can submit ByteArray data to a
server-side script by setting the URLRequest.data property to the
array. The problem is the docs don't seem to indicate how that data
is sent server-side - i.e. what's the key/value pair used?

My server-side code gets triggered, but the data sent doesn't look
like a regular multipart form data that you would receive from a File
upload. I can't parse the data.

Here's what I'm doing (the dataToPost ByteArray will contain Bitmap data):

public function postData(dataToPost:ByteArray):void
{
// Create a loader and init it's events
var loader:URLLoader = new URLLoader();
configureListeners(loader);

// Create a Request object
var url:String = "http://localhost/test/upload.aspx";
var request:URLRequest = new URLRequest(url);
request.contentType = "multipart/form-data";
request.method = URLRequestMethod.POST;

// Set the data
request.data = "">
try
{
// Execute the send
loader.load(request);
}
catch (error:Error)
{
trace("Unable to load requested document.");
}
}

Thanks for any insight!

B.

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





YAHOO! GROUPS LINKS




__,_._,___

Reply via email to