Form fields with file upload (in one form )doen't support unicode(other than default english)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Form fields with file upload (in one form )doen't support unicode(other than default english)

navid shakooian
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: [hidden email]
For additional commands, e-mail: [hidden email]