Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 23706
50
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!