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. 

  • 相关阅读:
    MySql--密码查看或修改
    javaweb学习--Servlet开发(一)
    javaweb学习--http协议
    Vue.js学习笔记(一)
    javascript事件处理
    javascript时间的相关操作
    代理模式(Proxy)
    单例模式(Singleton)
    ArrayBlockingQueue和LinkedBlockingQueue队列
    自增(++)和自减(--)运算符
  • 原文地址:https://www.cnblogs.com/fangzhaolee/p/2584427.html
Copyright © 2011-2022 走看看