【发布时间】:2013-03-12 10:08:13
【问题描述】:
我正在尝试在 PHP 中膨胀 Flash 压缩缓冲区。
这是我在 Flex ActionScript 中的内容:
var comp:ByteArray = new ByteArray();
comp.writeObject(buffer);
comp.compress(CompressionAlgorithm.DEFLATE);
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;
request.contentType = contentType;
request.data = comp;
loader.load(request);
comp的内容会以post数据的形式上传到服务器。一个 php 脚本会膨胀它:
$contents = gzinflate(file_get_contents($file));
问题是这样一来,$contents 的内容与buffer 不完全相同。它确实膨胀了,但它总是增加 4 个额外的字节。例如,32000 字节变成了 32004 字节。不知道是开始还是结束。
是否有任何关于这 4 个字节是什么的文档,以及我应该如何在 php 中扩充这些数据?谢谢。
【问题讨论】:
标签: php flash apache-flex actionscript