firefox uploadify http 302 error

今天遇到一个问题  由于项目需要利用uploadify 实现无动态文件上传

在IE下运行正常,但是firefox报错--http 302 error

后经google了解到由于uploadify是利用flash来实现无动态文件上传的,flash在firefox下重新发起session会话,由于session没有验证通过所以报错

解决办法:在文件上传的路径上加上;jsessionid=<%=session.getId()%> 及每次带上sessionId

注意是:   ;jsessionid=<%=session.getId()%>

原报错代码:

<input id="testFileInput" type="file" name="strFilePath"  uploaderOption="{swf:'${ctx}/static/styles/management/uploadify/scripts/uploadify.swf',
   uploader:'${ctx}/common/uploadFile',
   formData:{id:'${task.id}', ajax:1},
   queueID:'fileQueue',
   buttonImage:'${ctx}/static/styles/management/uploadify/img/add.jpg',
   buttonClass:'my-uploadify-button',
   width:102,
   auto:true,
   removeCompleted:false
  }"/>

修改后代码:

<input id="testFileInput" type="file" name="strFilePath"  uploaderOption="{swf:'${ctx}/static/styles/management/uploadify/scripts/uploadify.swf',
   uploader:'${ctx}/common/uploadFile;jsessionid=<%=session.getId()%>',
   formData:{id:'${task.id}', ajax:1},
   queueID:'fileQueue',
   buttonImage:'${ctx}/static/styles/management/uploadify/img/add.jpg',
   buttonClass:'my-uploadify-button',
   width:102,
   auto:true,
   removeCompleted:false
  }"/>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章