Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Please help me ::::I have problem with uploading form fields and file uploading together (

    0 answers - 1956 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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,"//");
    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();
    Do You Yahoo!?
    Tired of spam? Yahoo! Mail has the best spam protection around
    http://mail.yahoo.com
    To unsubscribe, e-mail: commons-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: commons-user-help (AT) jakarta (DOT) apache.org

Re: Please help me ::::I have problem with uploading form fields and file uploading together (


max 4000 letters.
Your nickname that display:
In order to stop the spam: 7 + 6 =
QUESTION ON "Java"

EMSDN.COM