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. 

  • 相关阅读:
    AWT布局管理器
    聊一聊Java中的各种运算符
    Java中数组操作 java.util.Arrays 类常用方法的使用
    Python中的可变对象与不可变对象、浅拷贝与深拷贝
    【WEB基础】HTML & CSS 基础入门(7)表格
    pycaffe cifar10
    caffe 调试
    caffe Dtype
    caffe 逐步调试
    caffe template
  • 原文地址:https://www.cnblogs.com/fangzhaolee/p/2584427.html
Copyright © 2011-2022 走看看