Today in the use of Uploadify upload plugin encountered a problem, because I have done a privilege management, each request has to read the session to judge the permissions, but the plugin found after the login can not upload, because in the reading session when I think there is no authority to be intercepted, Later in the background print log in the ID of the session and read the session ID, it is not the same, in the online search, there are really a lot of people encounter this problem, the solution is posted:
First talk about my environment, backstage is using the jsp,uploadify version is 3.2
Configuration in JSP page:
Copy Code code as follows:
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("#fileupload"). Uploadify ({
' swf ': '/uploadify/scripts/uploadify.swf ',
' Uploader ': '/fileupload;jsessionid=${pagecontext.session.id} ',
' Auto ': true,
' Multi ': false,
' ButtonText ': ' BROWSE ',
' Filedesc ': ' Support format: jpg/gif/jpeg/png/bmp. ',
' Fileext ': ' *.jpg;*.gif;*.jpeg;*.png;*.bmp ',
' Onuploadsuccess ': onuploadsuccess
});
});
</script>
The key is the red word that part, to note that the front of the jsessionid is a semicolon rather than a question mark, written as a question mark as a parameter passed, hoping to help everyone less detours