1

I am trying to upload file using enctype="multipart/form-data" to servlet. Everything works fine with English file name but when I upload file with Thai file name, the file name get from servlet Part is not Thai.

I have tried enctype="multipart/form-data;charset:utf8" --> still not work I have tried to encode String file name with utf-8 --> still not work

Anyway to encrypt, please help

Note: I adopt ajaxForm to help submit form

$("#uploadform").ajaxForm({
1615903
  • 32,635
  • 12
  • 70
  • 99
Gibi
  • 451
  • 1
  • 3
  • 12
  • I am not sure what the problem with it. Sorry if I misunderstood it as encryption. It is about the language changed when uploading file. Any suggestions? – Gibi May 09 '16 at 07:00
  • Fixed the tags for you. Anyway, the solution is to use the same encoding in both the client and the server. UTF-8 is a good choice. – 1615903 May 09 '16 at 07:15
  • Thanks for fixing the tags. I already have for html then I have tired encoding with UTF-8 with the file name got from Servlet Part. Still not work – Gibi May 09 '16 at 07:29

1 Answers1

1

Have you try

request.setCharacterEncoding("UTF-8"); 

in the servlet before anything else ?

palamike
  • 56
  • 5