Using Uploadify with Spring MVC

I am trying to use the Uploadify plugin with Spring MVC to upload a bunch of files. I am authenticated, but my request continues to lose, because when the Flash-based plugin makes a request, it lacks a session identifier. There are many examples of how to make this work with php .. I did not find any help for this case on the forum. Any ideas?

$('#uploadify_upload').uploadify({ 'uploader' : '../js/uploadify.swf', 'script' : '/myproj/FileUploader/upload, 'cancelImg' : '../images/uploadify-cancel.png', 'auto' : false, 'multi' : true, 'scriptAccess' : 'always', 'checkExisting': false, 'onComplete' : function(event,ID,fileObj,response,data) { alert("complete"); }, 'onError' : function(event,ID,fileObj,errorObj){ alert("Error"); } }); }); function handle(){ $('#uploadify_upload').uploadifyUpload(); } 

HTML:

 <div> <input id="uploadify_upload" name="uploadify_upload" type="file" /> </div> <div> <input type="submit" value="submit" name="submit" onClick="handle()"/> </div> 
+4
source share
1 answer

You must modify your script to add the JSESSIONID to the SWIFT Uploadify name, similar to the solution proposed in SO for another SWF Uploader tool .

So something like this should work (assuming the Javascript that you note above is in the JSP):

  $('#uploadify_upload').uploadify({ 'uploader' : '../js/uploadify.swf?<%=request.getSession().getId()%>', 

If you are not creating this Javascript from the JSP, you need to figure out how to get the JSESSIONID in the Javascript that causes the load - you may need to enter a parameter to the function that completes the load, etc.

+3
source

All Articles