私たちはこれに困惑しており、助けが欲しいです!
私たちのユーザーは、Flash で TIF を作成し、Base64 の画像データを HTTP POST 経由で ASPX サーバーに投稿しています。
byte[] bytes = Convert.FromBase64String(Request.Form["ImgData"] );
この方法は機能することがわかりましたが、20 ~ 30 ほどのケースのいずれかで、サーバーによって受信されたデータの量が、クライアントが送信していると主張するものとは異なります。ASPX コード:
dataLengthSentFromClient = Request.Form["dataLengthFromClient"].ToString();
<>
ReceivedBytesLength=Request.Form["ImgData"].Length.ToString();
しかし、他の24回はうまく機能しているようです。何か案は?この方法で Flash からサーバーにデータを渡すべきではありませんか?
(これがクライアント AS コードです) var image:BitmapData;
if (toTrim) {
tempBitmapData=new BitmapData(workingSrc.width,workingSrc.height,true,0x00000000);
tempBitmapData.draw(workingSrc);
var tempBitmap:Bitmap=new Bitmap(tempBitmapData,PixelSnapping.ALWAYS,true);
bounds=tempBitmapData.getColorBoundsRect(0xFF000000,0x00000000,false);
var letterMatrix:Matrix=new Matrix(1,0,0,1,- bounds.x,- bounds.y);
tempBitmap.transform.matrix=letterMatrix;
image=new BitmapData(bounds.width,bounds.height,true,0x00000000);
image.draw(tempBitmap,letterMatrix);
} else {
image=new BitmapData(workingSrc.width,workingSrc.height,true,0x00000000);
image.draw(workingSrc,letterMatrix);
}
var bytes:ByteArray=PNGEncoder.encode(image);
var base64Bytes:String=Base64.encodeByteArray(bytes);
var vars:URLVariables = new URLVariables();
vars.activityID=activityID;
vars.imgData=base64Bytes;
vars.dataLengthFromSarah=vars.imgData.length;
vars.activityLocation=activityLoc;
vars.op="writePNG";
if (fileName!=null) {
vars.filename=fileName;
}
// Save info about the variables passed in case we need to dump error data
dispatchEvent(new DumpPrepEvent(vars.toString()));
var url:URLRequest=new URLRequest(INTERFACE);
url.data=vars;
url.method=URLRequestMethod.POST;