This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts file upload (Encoding issue) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts file upload (Encoding issue)" Watch "Struts file upload (Encoding issue)" New topic

Struts file upload (Encoding issue)

Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Hi I am trying to upload a file using FormFile.So it creates a temporary file in the server.To get the bytes of that file I can use FormFile.getFileData().Can anyone tell me what would be the encoding of those bytes.Will that be UTF-8 or encoding from the OS(that is System.getProperty("file.encodign")).

Rahul Bhattacharjee
LinkedIn - Blog
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
hmmm...maybe I am missing out on something but I have used FormFile several times to upload binary and text files and store them either in an Oracle database or as a file on a Solaris based server and I never had to worry about byte encoding. Are you seeing problems?

- Brent
I agree. Here's the link:
subject: Struts file upload (Encoding issue)
It's not a secret anymore!