• Post Reply Bookmark Topic Watch Topic
  • New Topic

MultipartRequest getting java.io.IOException when setting UTF-16 in constructor  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings, i am getting an IOException ( java.io.IOException: Corrupt form data: premature ending ) when i make the following call when uploading a file

MultipartRequest requestMP = new MultipartRequest(request, uploadDir, maxSize, "UTF-16");

I've tried with different encodings like UTF-8 or ISO-8859-1 and it works, I believe there is a problem with this servlet and the encoding UTF-16, but i haven't found anything about it... does anybody know if this is a known issue??
 
Sheriff
Posts: 23594
48
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jesus, welcome to the Ranch!

I don't have any good suggestions, but here's a guess: perhaps you could specify UTF-16LE or UTF-16BE for the encoding, whichever is the right one?
 
rubbery bacon. rubbery tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!