【发布时间】:2011-08-29 13:41:39
【问题描述】:
我使用此代码将图像转换为 BitmapData 并将 JPG 存储在 ByteArray 中。
import com.adobe.images.JPGEncoder;
var jpgSource:BitmapData = new BitmapData (img_mc.width, img_mc.height);
jpgSource.draw(img_mc);
var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
// here we need some code to send the bytearray but I lack enough knowledge to do it by myself
现在,我想做以下事情: 1. 将 ByteArray 发送到 PHP; 2. PHP必须在服务器上存储一个物理的image_id.jpg; 3. 那么PHP必须将图片的URL返回给Flash;
这可能吗?怎么样?
PHP 的第一行可能是:
if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{
// get bytearray
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
// but I don't know how to save the image on disk and how to return the URL of the //image
}
谢谢!
【问题讨论】: