Results 1 to 1 of 1
- 02-04-2011, 06:05 PM #1Member
- Join Date
- Feb 2011
- Rep Power
Unicode Text Fileupload using MultipartRequest Failing
I am working on an existing application which allows the user to submit a CSV file for upload. Post submit, the servlet uses MultipartRequest API to transfer the file to a location on the Unix server. Then an Oracle St Proc is called which traverses this file and inserts each row into a table.
Recently there was a change-request to support German and Japanese characters in the CSV file for upload. As CSV won't support these chars, the file was saved as "Unicode Text" type and below JAVA changes were made:
MultipartRequest multi = new MultipartRequest(request, "/tmp", 20000000, "UTF-8"); // UTF-8 was introduced to support the Unicode File type. This parameter was not used for CSV files before.
The file is being transferred to the destination, but the foreign chars and the regular chars are distorted with addition of unwanted chars. This was verified by doing a "vi" and "cat" in Unix. If this file is transferred back to Windows using WinSCP, the file looks ok. Also, the Oracle PL/SQ code is failing because of this distortion.
Hence below are my questions. Feel free to answer whatever you are aware of:
1. Can MultipartRequest support Unicode text files?
2. If yes, then do I have to modify the parameters in the above JAVA call?
3. Is there specific requirements on the Oracle side to handle such files? Below are the highlights of the current Oracle code.
f_handle := UTL_FILE.fopen_nchar('TMP_DIR',p_filename,'R');
Personally, I feel that this is a complex approach and could have been simplified by allowing JAVA to handle the data and make insert requests to Oracle. But before making such design changes, I want to rule out any possible encoding/setting related fixes.
Any suggestions are appreciated.
- By Kelly in forum Java ServletReplies: 1Last Post: 05-19-2010, 09:10 AM
- By soccermiles in forum New To JavaReplies: 2Last Post: 04-26-2010, 07:53 PM
- By sandeep.ctg in forum Web FrameworksReplies: 0Last Post: 04-07-2010, 01:06 PM
- By pvn_myne in forum Enterprise JavaBeans (EJB)Replies: 0Last Post: 08-19-2009, 08:36 AM
- By levent in forum Java SoftwareReplies: 0Last Post: 05-12-2007, 12:24 PM