我现在用weboffice和JAVA结合上传,但是好像没有跳对方页面:
但是临时目录都已经产生了,你们有遇到些类问题吗?上传代码:
var webObj=document.getElementById("WebOffice1");

var returnValue;

webObj.HttpInit(); //初始化Http引擎

// 添加相应的Post元素 
webObj.HttpAddPostString("docType",docType);
webObj.HttpAddPostCurrFile("file","");  上传文件(类似type="file"),第二个参数为空自动取名。

returnValue = webObj.HttpPost("/test.jsp"); // 判断上传是否成功

        if("success" == returnValue){
            alert("文件保存成功!");
        }else{
            alert("文件保存失败!");
        }  

解决方案 »

  1.   


    后台cs里的pageload:
      protected void Page_Load(object sender, EventArgs e)
        {  
            string url="http://" + Request.ServerVariables["HTTP_HOST"].ToString() + Request.ServerVariables["PATH_INFO"].ToString();  //获得URL的值
            int i=url.LastIndexOf("/");
            url=url.Substring(0,i);  
            this.Session["URL"] = url; //定义Sesssion变量
        }
    前台
    <% string URL = this.Session["URL"].ToString(); %>JS里:
    HttpPost("/test.jsp");修改为:
    webObj.HttpPost("<%=URL %>/test.jsp");    
    原理这里使用绝对路径试试看