I use SWFUpload to upload files to the Java servlet (spring framework). The problem is that the current web session is lost during file download (it creates a new session). I read that this is a known bug, and there are some workarounds, but I can not find anything. Does anyone know how to make it work?
Thanks.
Check out this post on the SWFUpload forums. Adding ;jsessionid=XXX to the download url may work for you, or it may not be so; the exact cause of the problem is unclear. Note that Flash uses the Wininet stack (the same as IE), so if you use a different browser, you need to somehow get the session cookie (known to your browser) in the IE cookie.
;jsessionid=XXX
This is also on the .NET platform. The problem is that Flash Object works in a different session context than the Java application (it is effectively processed as a new client). One way to get around all this is to efficiently send an object of any necessary information needed to fix the downloads in the request.
The known bug you are describing sounds like this . If you have time, subscribe, just say: βI have this problem too,β so we can fully understand Adobe that it affects a lot of people.
It is hard to give an example of the best way to do this for your specific situation, since I know little about spring.
However, the usual way around this is to add a session GET variable to the download URL, then take this and manually set up a server-side session for it.
Here is another SO thread about this issue that has a good answer (unfortunately not specific to java + spring, but might give you a better idea).
We hope that this is enough so that you can start well.