You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Askar Zaidi <as...@gmail.com> on 2007/05/25 01:18:29 UTC

Streaming API error

Hi,

I am using this sample code from the website :

// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload();

// Parse the request
FileItemIterator iter = upload.getItemIterator(request);
while (iter.hasNext()) {
    FileItemStream item = iter.next();
    String name = item.getFieldName();
    InputStream stream = item.openStream();
    if (item.isFormField()) {
        System.out.println("Form field " + name + " with value "
            + Streams.asString(stream) + " detected.");
    } else {
        System.out.println("File field " + name + " with file name "
            + item.getName() + " detected.");
        // Process the input stream
        ...
    }
}


however, I get :  Streams.asString(stream);
as Cannot find symbol..

What do I need to include ?

thanks
AZ