w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Apache Commons FileUpload getString() method - Java

Finally found the answer. I have done a silly mistake by initializing the i inside the while loop.

int i = 0;
while (iterator.hasNext()) {
    FileItem item = (FileItem) iterator.next();

    if (item.isFormField()) {
        myValues[i] = item.getString();
        System.out.println("my vals: "+myValues[i]); //PRINTS THE VALUES
    }
    i++;
}




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.