commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From navid shakooian <>
Subject Form fields with file upload (in one form )doen't support unicode(other than default english)
Date Mon, 11 Jul 2005 13:24:38 GMT
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 {
            upload = new DiskFileUpload();
            Msg = upload.getHeaderEncoding();

// Parse the request
            List items;
//                items =
            items = upload.parseRequest(request, 1024,
100000, "e://gomroku1");

            Iterator iter = items.iterator();

            while (iter.hasNext()) {
                FileItem item = (FileItem);

                if (item.isFormField()) {
                    //form fields

                    String name = item.getFieldName();
---->>>>invalid characters))))   String value =
                    if( value == null) value="";
                } else {
                    //upload fields
                    String fieldName =
                    String fileName = item.getName();
                    File   extractfile = new;
                    fileName = extractfile.getName();
                    if( fileName == null) 
                    String contentType =
                    boolean isInMemory =
                    long sizeInBytes = item.getSize();

Sell on Yahoo! Auctions – no fees. Bid on great items.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message