Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 39394 invoked from network); 6 Jul 2010 10:10:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Jul 2010 10:10:16 -0000 Received: (qmail 84783 invoked by uid 500); 6 Jul 2010 10:10:15 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 84277 invoked by uid 500); 6 Jul 2010 10:10:12 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 84266 invoked by uid 99); 6 Jul 2010 10:10:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 10:10:11 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of muratbirben@gmail.com designates 209.85.160.171 as permitted sender) Received: from [209.85.160.171] (HELO mail-gy0-f171.google.com) (209.85.160.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 10:10:03 +0000 Received: by gyg8 with SMTP id 8so2889119gyg.30 for ; Tue, 06 Jul 2010 03:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=fmAmbklD45vsrEgN9JbwtJjI864plGwlg35KzIpvYI4=; b=jcOiaoyBq+xXkyf8/UDzgHLDH+HnfG5RgmYf3cY8dmD34TW+Lqi3cunnNl+AW4CKJz UbEz3yVm+LaVAZ9w36SChido1EOELHVsRPSSrDZp1UIF+kJKfTZz81LIQFIZnqbAYp0a eCxDxImd3TeyLlcfj13OPnTn+7PserZYbVLxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=tGbYHleSkZG9IoF70XaLEAaZ5U3Pjl4Ji2DMXn6NifueMJ41fKXrG7f++5gX04sFFK A6PoE5VqstBI3u/RmBkRarODs7+fIB3HygKqhY0OsVmGHfj6ytex5uK+Tt7IShwVR2iZ 4/oHupGOllUcoa2AA1RshzQQIvt/OWvF6ekY4= Received: by 10.213.9.67 with SMTP id k3mr3791132ebk.78.1278410921241; Tue, 06 Jul 2010 03:08:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.14.119.65 with HTTP; Tue, 6 Jul 2010 03:08:21 -0700 (PDT) From: Murat Birben Date: Tue, 6 Jul 2010 13:08:21 +0300 Message-ID: Subject: getItemIterator(request) returns false To: user@commons.apache.org Content-Type: multipart/alternative; boundary=0015174c115ad66bbb048ab53c0d X-Virus-Checked: Checked by ClamAV on apache.org --0015174c115ad66bbb048ab53c0d Content-Type: text/plain; charset=ISO-8859-1 Hi all, I'm trying the stream api sample code in the site boolean isMultipart = ServletFileUpload.isMultipartContent(request); > > if (isMultipart) { > try { > // 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 > //... > } > } > > } catch (FileUploadException ex) { > > Logger.getLogger(ResourceUploadServlet.class.getName()).log(Level.SEVERE, > null, ex); > } > } > but iter.hasNext() always return false. Here is the jsp code:
> enctype="multipart/form-data"> > > > Description : > > > >
> > What is wrong with this stuff? Thanks... Best, -- Murat BIRBEN --0015174c115ad66bbb048ab53c0d--