Hi, I'm currently working on file uploading and downloading from client site to the server's site. One problem that I'm facing currently is after I downloaded files from the jsp, I received an "Error on page" error. When I double click on the exclaimation icon at the bottom left corner, the message details says that "Access is denied". I managed to download the file to the any location i wish, but after download, i just can't navigate to other page even though i click at the link. Any suggestion will be highly appreciated... Thank you very much
We've seen this problem before with file uploading. The problem is that the servlet container doesn't understand the encoding used to upload files and therefore can't pick the session ID from the HTTP header. The usual solution is to use response.encodeURL to make the session available as part of the url rather than having to look in the header. Dave
Joined: Jun 09, 2002
Thanks for the reply, but I'm not so understand about the reply, can you explain more details? In my jsp, I'm using out.println to print out the file url for user to click and download. The following is my code in jsp: out.println("<a href=servlet/download.downloadServlet?attachmentId=" +getAttachId() + "&filename="+URLEncoder.encode(getFName())+">" + getFName() + "</a>");
Tried to use response.encodeURL too, but i still have the same error.. String encodedurl = "servlet/download.downloadServlet?attachmentId=" +getAttachId() + "&filename="+getFName()); out.println("<a href="+response.encodeURL(encodedurl)+">"+ getFName() + "</a>"); Anything that i have missed out???