As End: (Form form)
Req.method = Urlrequestmethod.post;var Reqheader:urlrequestheader = new Urlrequestheader ("Content-type", "Application /x-www-form-urlencoded "); Req.requestHeaders.push (Reqheader);-->by;
var param:urlvariables = new Urlvariables ();
var encoder:base64encoder = new Base64encoder (); Encoder.encodebytes (by);p Aram.data = encoder.tostring ();
Param.content = "Above this by is a binary array, slice, etc.";
Req.data = param;
Urlloader.load (URLRequest);
C # side receive:
System.IO.Stream s = system.web.httpcontext.current.request.inputstream;int count = 0;byte[] buffer = new byte[1024]; StringBuilder builder = new StringBuilder (); while ((Count = s.read (buffer, 0, 1024x768) > 0) {Builder. Append (Encoding.UTF8.GetString (buffer, 0, Count));} ........
Urlstr = "..." String text= System.Web.HttpUtility.UrlDecode (Urlstr, System.Text.Encoding.UTF8); byte[] Bpath = Convert.frombase64string (text); string filePath = "Picture 123.jpg"; Stream stream = new MemoryStream (Bpath), using (Bitmap B = new Bitmap (stream)) {B.save (FilePath, imageformat.jpeg);}
Because the server-side string urlstr from the URL is URL-encoded, it needs to be decoded into UTF-8 using System.Web.HttpUtility.UrlDecode
AS3 Post parameters and ByteArray methods and server-side reception