用ASP保存Flash的图像(BitmapData)

  核心提示:as:var loader:URLLoader=new URLLoader();var request:URLRequest=new URLRequest();request.contentType='application/octet-stream';request.method=URLReque…

itE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">as:

var loader:URLLoader=new URLLoader();

var request:URLRequest=new URLRequest();

request.contentType="application/octet-stream";

request.method=URLRequestMethod.POST;

request.data=JPEGEncoder.encode(bitmapData);

loader.load(request);



asp:

<%

if request.servervariables("REQUEST_METHOD")="POST" then

size=Request.TotalBytes

set dr=CreateObject("Adodb.Stream")

dr.Mode=3

dr.Type=1

dr.Open

dr.Write Request.BinaryRead(size)

dr.SaveToFile Server.MapPath("upload.jpg"),2

dr.Close

set dr=nothing

response.Write "ok"

end if

%>

未经允许不得转载:445IT之家 » 用ASP保存Flash的图像(BitmapData)

赞 (0) 打赏

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏