最近项目中使用了flash上传图片 用的是swfupload 但是在火狐下出现了登录验证无法通过的问题 也去网上查了好久 但无论是在URL后面拼接jsession upload_url: "http://localhost:8080/yhzx/teacher/uploadMicrlImg;jsessionid=${pageContext.session.id }?imgdown=users/", 还是加上post_params:{"JSESSIONID":"<%=session.getId()%>"}, 都不能达到效果 只能绕过登录拦截 另外还有一个更奇葩的问题 我有两个项目 前台A和后台B 然后我在A项目中向B上传图片后 就会造成A中的session丢失 然后被重定向到登录页面 本人新手一个 跪求各位大神指点一二 不胜感激
var settings = {
flash_url : "http://localhost:8080/yhzx/swfupload/swfupload.swf",
upload_url: "http://localhost:8080/yhzxjyOA/micrlClass/uploadMicrlImg;jsessionid=${pageContext.session.id }?imgdown=users/",
//post_params:{"JSESSIONID":"<%=session.getId()%>"},
file_size_limit : "6 MB",
file_types : "*.gif;*.png;*.jpg;*.jpeg;*.bmp",
file_post_name: "uploadImgFile",
file_types_description : "图片文件",
file_upload_limit : 0,
file_queue_limit : 1,
prevent_swf_caching?:?true,//在相关的swf文件增加随机参数以避免Flash被缓存
custom_settings : {
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
},
debug: false,
// Button Settings
button_image_url : "<c:url value='/swfimages/photo.png'/>",
button_placeholder_id : "spanButtonPlaceholder",
//指定Flash按钮的宽度
button_width: 100,
button_height: 101,
button_text: '',
button_text_style: ".spanButtonPlaceholder { font-size: 50; }",
button_text_left_padding: 12,
button_text_top_padding: 3,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : imgUploadSuccess,
upload_complete_handler : uploadComplete,
queue_complete_handler : queueComplete // Queue plugin event
};
swfupload = new SWFUpload(settings);
var settings = {
flash_url : "http://localhost:8080/yhzx/swfupload/swfupload.swf",
upload_url: "http://localhost:8080/yhzxjyOA/micrlClass/uploadMicrlImg;jsessionid=${pageContext.session.id }?imgdown=users/",
//post_params:{"JSESSIONID":"<%=session.getId()%>"},
file_size_limit : "6 MB",
file_types : "*.gif;*.png;*.jpg;*.jpeg;*.bmp",
file_post_name: "uploadImgFile",
file_types_description : "图片文件",
file_upload_limit : 0,
file_queue_limit : 1,
prevent_swf_caching?:?true,//在相关的swf文件增加随机参数以避免Flash被缓存
custom_settings : {
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
},
debug: false,
// Button Settings
button_image_url : "<c:url value='/swfimages/photo.png'/>",
button_placeholder_id : "spanButtonPlaceholder",
//指定Flash按钮的宽度
button_width: 100,
button_height: 101,
button_text: '',
button_text_style: ".spanButtonPlaceholder { font-size: 50; }",
button_text_left_padding: 12,
button_text_top_padding: 3,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : imgUploadSuccess,
upload_complete_handler : uploadComplete,
queue_complete_handler : queueComplete // Queue plugin event
};
swfupload = new SWFUpload(settings);