Hi gentlemen,
I'm trying to upload a file with some other text
fields that are in a form.But because characters I use
are in Persian (not in default english codepage) after
form fileds being parsed by upload.parseRequest() and
when I try to get form fields and values using
item.getFormField() and item.getString() I only have
garbages for values .
Could you please help me how I can add unicode support
to DiskFile upload and solve this problem?
Thanks all
Navid Shakooian
///////////////////////////////////////////
try {
request.setCharacterEncoding("UTF-8");
upload = new DiskFileUpload();
upload.setHeaderEncoding("UTF-8");
Msg = upload.getHeaderEncoding();
upload.setHeaderEncoding("UTF-8");
// Parse the request
List items;
// items =
upload.parseRequest(request,1024,100000,"//home//gomroku1//www//IMAGES//AKHBARS//tmp");
items = upload.parseRequest(request, 1024,
100000, "e://gomroku1");
Iterator iter = items.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem)
iter.next();
if (item.isFormField()) {
//form fields
String name = item.getFieldName();
---->>>>invalid characters)))) String value =
item.getString();
if( value == null) value="";
} else {
//upload fields
String fieldName =
item.getFieldName();
String fileName = item.getName();
File extractfile = new
java.io.File(fileName);
fileName = extractfile.getName();
if( fileName == null)
fileName="";
String contentType =
item.getContentType();
boolean isInMemory =
item.isInMemory();
long sizeInBytes = item.getSize();
____________________________________________________
Sell on Yahoo! Auctions no fees. Bid on great items.
http://auctions.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]