uploadify HTTP Error (302)錯誤

來源:互聯網
上載者:User

我發現我更新了flash的版本以後,用uploadify就會報302錯誤。研究了半天,發現我上傳的action中有根據session判斷使用者是否登入,如果沒有登入就跳到登陸頁,所以就出現了302跳轉錯誤。原來更新了flash的版本以後,通過uploadify擷取不到session的值。我目前的解決辦法是:

1 上傳action的url取消擷取session的操作,很簡單,把session的值提前擷取好,然後在url中用參數的形式帶過去就行。

原來的代碼:

jsp端:

$("#imageFile").uploadify({
                            height : 30,
                            swf : '/js/uploadify/uploadify.swf',
                            uploader      : '/upload.do',
                            width : 120,
                            onUploadSuccess : function(file, data, response) {
                                var datt=new Date();
                                var vdata=eval('(' + data + ')');
                                var vdatainfo=(datt.getYear()+1900)+'-'+(datt.getMonth()+1)+'-'+datt.getDate();
                                $(".statusinfo")
                                        .html(
                                                '最新動向時間:<span class="graytxt">'+vdatainfo+'</span> <a  class="btn_delete imageButtons"  href="javascript:void(0)" onclick="javascript:tododel('+vdata.rid+')"></a>');
                            }

                        });
    });

java:

Beike bksession = (Beike) req.getSession().getAttribute("bke");

改了以後:

jsp端:

$("#imageFile").uploadify({
                            height : 30,
                            swf : '/js/uploadify/uploadify.swf',
                            uploader      : '/upload.do?bkeid='+${bkeid},
                            width : 120,
                            onUploadSuccess : function(file, data, response) {
                                var datt=new Date();
                                var vdata=eval('(' + data + ')');
                                var vdatainfo=(datt.getYear()+1900)+'-'+(datt.getMonth()+1)+'-'+datt.getDate();
                                $(".statusinfo")
                                        .html(
                                                '最新動向時間:<span class="graytxt">'+vdatainfo+'</span> <a  class="btn_delete imageButtons"  href="javascript:void(0)" onclick="javascript:tododel('+vdata.rid+')"></a>');
                            }

                        });
    });

java端:

String bkeid = request.getParameter("bkeid");

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.