Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 24232 invoked from network); 8 Feb 2008 05:01:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2008 05:01:56 -0000 Received: (qmail 38669 invoked by uid 500); 8 Feb 2008 05:01:45 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 38598 invoked by uid 500); 8 Feb 2008 05:01:45 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 38589 invoked by uid 99); 8 Feb 2008 05:01:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2008 21:01:45 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of suminub@gmail.com designates 209.85.128.185 as permitted sender) Received: from [209.85.128.185] (HELO fk-out-0910.google.com) (209.85.128.185) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2008 05:01:16 +0000 Received: by fk-out-0910.google.com with SMTP id 26so3391018fkx.10 for ; Thu, 07 Feb 2008 21:01:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=qWDA6oXcLuDPAfzwBWXrK++ySnqEq3xkslaO95CL33o=; b=IUfqOlRDCq/yk/4rL33sEz4I7GpNejQF+E9EdEEi9DNfKzUwwko2dx6IWuiSUfVf7jAOOkOO2dvjHdH3lwOf/wVw+wV3SyWYCSlKUo9rdI0eOmp2XXMI8M1g2hkPSrZZvTESYfRxCOgGDy9PvbOp5HviJwvjv8SGJW0tc7zVBcU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=uUTBs2fp/KVg7g/IkPIzCO5Os8HfGXs8Rk8INdypg9RN6M6jsF9bJ1IfTPjkOxI5iS3wpOxmh3UizzgrUNSVKXpnTJSSXi+zWMbMyHUsPQtnHu9urSTlV1UZvUSnmPrJIz230bcnDqD7C/l1fa5fTG2HV4ImIyn0BHi6YZMMY9I= Received: by 10.78.149.15 with SMTP id w15mr21921001hud.72.1202446883011; Thu, 07 Feb 2008 21:01:23 -0800 (PST) Received: by 10.78.10.3 with HTTP; Thu, 7 Feb 2008 21:01:22 -0800 (PST) Message-ID: Date: Fri, 8 Feb 2008 00:01:22 -0500 From: "Edward S" To: "Jakarta Commons Users List" Subject: Re: File Upload Exception - request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded In-Reply-To: <16d6c6200802072050k2c31b7bpa9f62e48d9be8d6e@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_16588_29284842.1202446883005" References: <16d6c6200802072050k2c31b7bpa9f62e48d9be8d6e@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_16588_29284842.1202446883005 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Martin I tried both. the thing is, apart from the file parameter in the form there is another hidden field that contains a text value. if i use multipart/form-data, tht hidden field comes up as null. -S2. On 2/7/08, Martin Cooper wrote: > > On Feb 7, 2008 8:15 PM, Edward S wrote: > > > Hey guys, > > > > I am tryin to upload a JPG file and am getting this error: > > > > > > > org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException:the > > request doesn't contain a multipart/form-data or multipart/mixed > > stream, > > content type header is application/x-www-form-urlencoded > > > > > > let me explain what I am doing: > > > > I have a JSP that has the form that does the file upload. the enctype on > > the > > form is "multipart/mixed" > > > That's the problem, assuming you are submitting from a browser. AFAIK, > 'multipart/mixed' is neither valid nor supported in HTML, so the browser > is > ignoring your value and falling back to the HTML default, which is > 'application/x-www-form-urlencoded'. To post the file, you'll need to use > 'multipart/form-data'. > > -- > Martin Cooper > > > > > this JSP is included in a root JSP and the action submits the form to > the > > root JSP. > > > > Root JSP has a controller, that processes the request. When it tries to > > process this request, it gives me the above mentioned error. > > > > Any idea, where I am going wrong? > > > > thanks > > > > Ed. > > > ------=_Part_16588_29284842.1202446883005--