如何解决 Flash 错误 2176 [英] How to get around Flash error 2176

查看:22
本文介绍了如何解决 Flash 错误 2176的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Flex 应用程序中,用户需要能够上传和下载内容.但是,此内容受到访问限制,我需要在允许上传/下载之前进行权限检查.用户单击一个链接,然后使用 FileReference 类选择一个文件.FileReference 类不附加 cookie 信息,因此我无法使用会话.

In my Flex application, users need to be able to upload and download content. However, this content is access restricted, and I need to do a permissions check before allowing the upload/download. The user clicks a link, and then selects a file using the FileReference class. The FileReference class doesn't attach cookie information, so I can't use a session.

我想实现一个 2 步过程,其中客户端首先 ping 服务器以获取一次性使用令牌,然后使用一次性使用令牌作为参数进行上传或下载.然而,这个计划被错误#2176 挫败了,这显然是 FP10 的一个安全修复,它只允许在 MouseEvent 传播期间触发上传/下载.无论如何围绕这个?

I want to implement a 2 step process where the client first pings the server to get a one-time-use token, and then does the upload or download with the one-time-use token as a parameter. However, this plan is being foiled by error #2176, which is apparently a security fix to FP10, that only allows uploads/download to be triggered during a MouseEvent propogation. Anyways around this?

推荐答案

我得到了解决方案 此处.

 <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
                layout="absolute" 
                minWidth="955" minHeight="600"
                creationComplete="creationCompleteHandler(event)">
    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import mx.events.CloseEvent;
            import mx.events.FlexEvent;

            protected function creationCompleteHandler(event:FlexEvent):void
            {
                Alert.show("Now you can save the file!", "Test", Alert.OK|Alert.CANCEL, null, closeHandler);
            }

            protected function closeHandler( event:CloseEvent ):void
            {
                var fileReference :FileReference;

                if ( event.detail == Alert.OK )
                {
                    fileReference = new FileReference();
                    fileReference.save("http://www.bogdanmanate.com", "test.txt");
                }
            }
        ]]>
    </mx:Script>

</mx:Application>

这篇关于如何解决 Flash 错误 2176的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆