I'm using Adobe Flex to take a snapshot of some controls. I turn the PNG encoded bitmap data into a ByteArray. I then send the data to the server, through an ASP.NET page. On the Flex side of things, I send the data over with the following code:

var req:URLRequest = new URLRequest();
req.method = URLRequestMethod.POST;
req.data = snapshot.data;
req.contentType="application/octet-stream";
req.url = "snapshotuploadhandler.aspx";

var loader:URLLoader = new URLLoader; loader.load(req);

I assumed this code was incorrect, but it was actually the code in the receiving page. Instead of checking the "Files" property on the request object, I needed to read the InputStream on the request. Here is the working code:

if (Request.ContentLength > 0)
{
    byte[] buffer = new byte[Request.ContentLength];
    using (BinaryReader br = new BinaryReader(Request.InputStream))
        br.Read(buffer, 0, buffer.Length);
    return buffer;
}