Fixed file uploading/downloading that I broken when securing the session. Also fixed the Windows delete file problem. It turns out that closing FileInputStreams might have caused it.