retreive POST data from FLASH to ASP.Net

Posted by Martin Ongtangco on Stack Overflow See other posts from Stack Overflow or by Martin Ongtangco
Published on 2009-11-03T08:58:58Z Indexed on 2010/03/25 16:03 UTC
Read the original article Hit count: 533

Filed under:
|
|
|
|

here's my AS3 code:

var jpgEncoder:JPGEncoder = new JPGEncoder(100);
var jpgStream:ByteArray = jpgEncoder.encode(bitmapData);
var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
var jpgURLRequest:URLRequest = new URLRequest("/patients/webcam.aspx");
jpgURLRequest.requestHeaders.push(header);
jpgURLRequest.method = URLRequestMethod.POST;
jpgURLRequest.data = jpgStream;
navigateToURL(jpgURLRequest, "_self");

And here's my ASP.Net Code

try
            {
                string pt = Path.Combine(PathFolder, "test.jpg");
                HttpFileCollection fileCol = Request.Files;
                Response.Write(fileCol.Count.ToString());
                foreach (HttpPostedFile hpf in fileCol)
                {
                    hpf.SaveAs(pt);
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

im getting a weird error, HttpFox mentioned: "NS_ERROR_NET_RESET"

Any help would be excellent!

Thanks!

© Stack Overflow or respective owner

Related posts about actionscript

Related posts about flash