网上搜的:
在IE下一切运行都OK,在firefox下死活不成功,折腾了大半天。上google一查,说是firefox重新开了个session导致,因此url里加入jsessionid一切搞定。代码如下:
var swfu = new SWFUpload({
                button_image_url : "<%=path%>plugins/swfupload/img/upload.png",//指向图片按钮的位置
                button_placeholder_id : "spanButtonPlaceholder",//该按钮的ID名字
                button_width: 61,//按钮的宽度
                button_height: 22,//按钮的高度
                //button_text : '选择文件',//按钮中的文字
                flash_url : "<%=path%>plugins/swfupload/swfupload.swf"  ,//指向FLASH文件的位置
                upload_url: "<%=path%>upload.action;jsessionid=<%=request.getSession().getId()%>",//指向web项目下的名为upload的action
                file_post_name:"Filedata",
                post_params:{"filePath":"upload"},
                upload_complete_handler:uploadComplete,//用于处理文件上传结束的事件
                file_dialog_complete_handler : fileDialogComplete,//用于处理选择文件后触发的事件
                file_queued_handler : fileQueued,//用于处理选择文件后触发的事件
                upload_error_handler:uploadError,//用于处理上传失败触发的事件
                upload_success_handler:uploadSuccess,//用于处理上传成功触发的事件
                upload_start_handler:function(file){
                    //alert(file.name);
                    swfu.addPostParam("fileName",file.name);
                }
                });

解决方案 »

  1.   

    网上搜的:
    在IE下一切运行都OK,在firefox下死活不成功,折腾了大半天。上google一查,说是firefox重新开了个session导致,因此url里加入jsessionid一切搞定。代码如下:
    var swfu = new SWFUpload({
                    button_image_url : "<%=path%>plugins/swfupload/img/upload.png",//指向图片按钮的位置
                    button_placeholder_id : "spanButtonPlaceholder",//该按钮的ID名字
                    button_width: 61,//按钮的宽度
                    button_height: 22,//按钮的高度
                    //button_text : '选择文件',//按钮中的文字
                    flash_url : "<%=path%>plugins/swfupload/swfupload.swf"  ,//指向FLASH文件的位置
                    upload_url: "<%=path%>upload.action;jsessionid=<%=request.getSession().getId()%>",//指向web项目下的名为upload的action
                    file_post_name:"Filedata",
                    post_params:{"filePath":"upload"},
                    upload_complete_handler:uploadComplete,//用于处理文件上传结束的事件
                    file_dialog_complete_handler : fileDialogComplete,//用于处理选择文件后触发的事件
                    file_queued_handler : fileQueued,//用于处理选择文件后触发的事件
                    upload_error_handler:uploadError,//用于处理上传失败触发的事件
                    upload_success_handler:uploadSuccess,//用于处理上传成功触发的事件
                    upload_start_handler:function(file){
                        //alert(file.name);
                        swfu.addPostParam("fileName",file.name);
                    }
                    });