从as3的POST上传中获取ProgressEvent

时间:2020-03-06 14:24:34  来源:igfitidea点击:

有什么方法可以跟踪AS3中发布的上传的状态?有一个ProgressEvent,但是它返回有关响应的数据,而不是实际的POST上传。我正在发布图像的二进制数据,因此通常在50-100kb的范围内。

图片数据是在Flash本身内部生成的,因此至少就我所知我不能使用上载方法。

谢谢!

解决方案

也许我们可以在服务器端使用一个函数将进度事件发送到Flash对象?

看一下FileReference类。其中的进度事件将为我们提供有关上传的数据:

Dispatched periodically during the file upload or download operation. The progress event is dispatched while Flash Player transmits bytes to a server, and it is periodically dispatched during the transmission, even if the transmission is ultimately not successful. To determine if and when the file transmission is actually successful and complete, listen for the complete event.

他不是在问文件引用列表。

他和我一样有同样的问题,没有一种方法可以使发布数据的过程取得进展。我认为唯一的方法就是上面建议的方法,即从PHP发送以刷新一个progressEvent,以检查接收到的数据的大小(如果可能)。

再见