zoukankan      html  css  js  c++  java
  • Firefox浏览器中,Flex的FileReference上传文件,引发IOError

    1. I use Tomcat with realm auhentication (based on cookies) 
    2. I use URLLoader to get some XML data with Struts Action handlers 
        it is usual to set headers to disable cache in the browser like this: 
                 response.setHeader("Cache-Control","no-store"); // for HTTP1.1 
                 response.setHeader("Pragma","no-cache"); // for HTTP 1.0 
                 response.setDateHeader ("Expires", 0); // for proxy 

    3. I use FileReference to upload a file 
      
     Actual Results: 
    - when Tomcat set "Pragma: no-cache" on url used by URLLoader, FileReference won't work when I upload a file 
    - When I force to an empy string: "Pragma: ", FileRerence work ! 
      note: I created a J2EE filter to set the header like this: 

    response.setHeader("Cache-Control","no-store"); // I must use this to prevent response caching in HTTP 1.1 
    response.setDateHeader ("Expires", 0); // for proxy 
    response.setHeader("Pragma",""); 

     Expected Results: 
     FileReference should work even "Pragma: no-cache" is set on the server. 
      
     Workaround (if any): 
    - force "Pragma:" to an empty string, use only HTTP1.1 headers 
    - add the session in the url of FileReference like this: "/MyAction.do;jsessionid=F401B8249286E3BD7E8C7C0376B474D5" 

    Note: 
    When FileReference fail on "error #2038", the Server is never reach by the Flash player. 

  • 相关阅读:
    内层城循环应用——买衣服
    内外层循环用法
    自定义函数的应用
    少有人走的路 随笔
    拆单发货逻辑
    拆单发货-分布页
    拆单发货-主页
    SP--report存储过程
    关于C#对Xml数据解析
    C#模拟http 发送post或get请求
  • 原文地址:https://www.cnblogs.com/fangzhaolee/p/2584427.html
Copyright © 2011-2022 走看看