This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet and Html Encoding

 
Dharamvir (DV) Punia
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a jsp which uploads a file through a servlet, in Servlet when I
read the filename, its encoded. e.g
- original file name passed in jsp - dv_test.dec
- when i read in servlet after being submitted from jsp, the
name i get is dv_test.doc

So what's happending is "underscore" in filename is replaced with "_"

Below is what is in jsp header, I have tried without it still the same.
===================================================
<%@ page
language="java"
contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"
%>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
========================================================

The only thing I am doing different in JSP is setting the "enctype" in
form tag as shown below:
================================================================
<form name="fileUploadForm2"
action="/FileUploaderDB2/DB2FileUploaderServlet" method="post"
enctype="multipart/form-data">
=================================================================

Can someone tell me why this is happening and how it can be avoide.

Thanks.
-DV
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic