【问题标题】:What's causes Security Violation error when browsing for files浏览文件时出现安全违规错误的原因是什么
【发布时间】:2011-03-18 14:13:27
【问题描述】:

我有一个带有一个按钮的 mxml 项目,它可以浏览文件然后上传它们。似乎当我选择一个小于 200kb 的文件时它通过了,但是当文件更大时它抛出 SecurityError: Error #2000: No active security context。这些限制在哪里设置大小限制?

protected function button1_clickHandler(event:MouseEvent):void
        {
            var imageTypes:FileFilter = new FileFilter("Images (*.jpg, *.gif, *.png)", "*.jpg; *.gif; *.png; *.JPG; *.GIF; *.PNG");
            var allTypes:Array = new Array(imageTypes);
            fileRef.addEventListener(Event.SELECT, startUp);
            fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, completeHandler);
            fileRef.browse(allTypes);

        }
        public function startUp(e:Event) : void {
            req = new URLRequest("http://www.sample.com/index.php/create/upload")
            fileRef.upload(req);
        }

【问题讨论】:

  • 我刚刚测试了正确的文件大小,通过它的 126kb 更大的文件会引发安全错误

标签: flash apache-flex security actionscript


【解决方案1】:

对不起,错误信息似乎是我的 Web 服务器与 FastCGI 一起工作。有一个配置选项 MaxRequestLen 并且有一个小尺寸限制

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-20
    • 1970-01-01
    • 2012-02-04
    • 1970-01-01
    • 1970-01-01
    • 2020-12-10
    相关资源
    最近更新 更多