Ah, interesting. This seems related, but different. I was just setting URLRequest.data to a ByteArray directly. In your case, if I understand application/x-www-form-urlencoded correctly, then zero bytes should just be replaced with %00. Have you filed a bug? I'd like to add that to my Adobe JIRA watch list if so. -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com
-----Original Message----- From: Troy Gilbert <[EMAIL PROTECTED]> Reply-To: [email protected] To: [email protected] Subject: Re: [flexcoders] URLRequest, ByteArray, and the 0 byte Date: Mon, 29 Sep 2008 22:33:14 -0500 > We're also working around this by Base64-encoding, but this is clearly > less than ideal. It definitely seems like a Flash Player bug. We ran > into this when doing AlivePDF REMOTE saves (i.e., bouncing the file off > the server). Do you know when you ran into this, Troy? I tested our > particular problem on Windows and on OS X last week, and neither had the > issue. // this byte array probably needs to be bigger to actually end up // with a zero-byte in the compressed data var bytes:ByteArray = new ByteArray(); bytes.writeUTFBytes("This is just some filler text."); bytes.compress(); // URLVariables automatically encodes its dynamic properties // using a www-form-url-encode format, i.e. %12%34%56%78%90 var variables:URLVariables = new URLVariables(); variables.username = "troy"; variables.action = "save"; variables.data = bytes; // when the request is made, 'variables' is converted to a string // the nulls in the ByteArray are not escaped, so they truncate the data var request:URLRequest = new URLRequest("http://mywebserver/myscript.php"); request.method = URLRequestMethod.POST; request.data = variables; // Troy.

