1
我在我的AS3 Flash代碼中使用JPGEncoder在swf中截取了一個屏幕快照並將其發送到URL,我將它寫入到一個文件中PHP。最新谷歌Chrome瀏覽器停止Flash(AS3)發送POST數據到瀏覽器
此代碼已運行很長時間,但自從最新的Google Chrome更新33.0.1750.146後,該功能停止並且頁面無法重定向。沒有得到發送save.php
我已經在Safari,Firefox,IE和更低版本的Chrome中測試了最高達33.0.1750.117,並且都工作得很好。
所以肯定這是一個問題純粹與最新的鉻?我能做些什麼來解決這個問題嗎?
我的代碼是:
AS3:
function createJPG(m:MovieClip, q:Number, fileName:String) {
var jpgSource:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight);
jpgSource.draw(stage);
var jpgScreenshot: BitmapData = new BitmapData(362, 310);
jpgScreenshot.copyPixels(jpgSource, new Rectangle(288, 89, 362, 310), new Point(0, 0));
var jpgEncoder:JPGEncoder = new JPGEncoder(q);
var jpgStream:ByteArray = jpgEncoder.encode(jpgScreenshot);
var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");
var jpgURLRequest:URLRequest = new URLRequest ("http://www.url.com/save.php");
jpgURLRequest.requestHeaders.push(header);
jpgURLRequest.method = URLRequestMethod.POST;
jpgURLRequest.data = jpgStream;
var jpgURLLoader:URLLoader = new URLLoader();
navigateToURL(jpgURLRequest, "_self");
}
save.php:
$imagefile=''.$imageURL.'';
$fp = fopen($imagefile, 'wb');
fwrite($fp, $GLOBALS['HTTP_RAW_POST_DATA']);
fclose($fp);
header('Location: https://www.url.com/your-image.php');
歡迎辣椒閃存從您的好朋友在谷歌。 **快速修復:**禁用Pepper Flash並啓用「常規」Flash(可能爲版本12,0,0,43)。 **永久解決方案:**我不知道。辣椒閃光似乎是導致各種問題(見[本頁](http://stackoverflow.com/questions/21197879/updated-swf-doesnt-start-in-chrome-pepper-flash?rq=1)和[this page](http://stackoverflow.com/questions/21278329/weird-flash-player-glitch-12-0-0-41-in-chrome-only))。沒有相關性出現在我身上。如果你解決了你的問題,請分享。 (順便說一句,HTTP URLRequest在aScript中,但在https重定向在PHP?) – Frankenscarf
謝謝你推動我正確的方向與辣椒閃存。在知道導致它的原因後,我在下面找到了解決方法 –