Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DCD76C3F7 for ; Tue, 12 Mar 2013 01:23:14 +0000 (UTC) Received: (qmail 29070 invoked by uid 500); 12 Mar 2013 01:23:14 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 28941 invoked by uid 500); 12 Mar 2013 01:23:14 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 28932 invoked by uid 99); 12 Mar 2013 01:23:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Mar 2013 01:23:14 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hablutzel1@gmail.com designates 74.125.82.174 as permitted sender) Received: from [74.125.82.174] (HELO mail-we0-f174.google.com) (74.125.82.174) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Mar 2013 01:23:09 +0000 Received: by mail-we0-f174.google.com with SMTP id r6so4136451wey.33 for ; Mon, 11 Mar 2013 18:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=+Zpvg+xcH+E80zio2HJwIE7AfPK+KfpfEX/Dx3hAuXI=; b=MorEe7E7vgxsGv73HnSPVWOOUDjgYhggutwYbefE6pN1eAHLNYn8egACsdnV1e6VUl gQeBOBC0jvD2ZUadjRUqwb/nx8j49ByrhoVbLmMN648wKpsF0/GDeUR2HjUv3Y2Y1p7j o9LaiWZi16kK7GgZjWKxc2py+tbvQmQc02hi4SOWLeHT/Ywvuw0+aMzFp8LUFlMfifgB jnXc3slNxtsghFXdG5uG9SPkRr64rIWBTEp3lcSdGAudHbjNXX05OFPcDXXKqBW2KgWJ I7LUKdzONO+dgP4VIRUBC+77BXNEXzyd+hFE23BS3c/XPRUnxwCJozeOvhkfYcJ1wlla t7Xw== X-Received: by 10.180.38.101 with SMTP id f5mr16268255wik.25.1363051367951; Mon, 11 Mar 2013 18:22:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.5.6 with HTTP; Mon, 11 Mar 2013 18:22:27 -0700 (PDT) In-Reply-To: References: From: Jaime Hablutzel Egoavil Date: Mon, 11 Mar 2013 20:22:27 -0500 Message-ID: Subject: Re: Wrong processing for encoding of Content-disposition 'filename' parameter To: dev@commons.apache.org Content-Type: multipart/alternative; boundary=e89a8f64337298f43c04d7b02056 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f64337298f43c04d7b02056 Content-Type: text/plain; charset=ISO-8859-1 nothing on this? On Fri, Mar 8, 2013 at 10:38 AM, Jaime Hablutzel Egoavil < hablutzel1@gmail.com> wrote: > I'm looking that commons fileupload uses a 'headerEncoding' variable which > Javadoc explanes: > > Specifies the character encoding to be used when reading the headers of >> individual part. When not specified, or null, the request encoding is used. >> If that is also not specified, or null, the platform default encoding is >> used. > > > Well, this headerEncoding is responsible for decoding the 'filename' > parameter value too, but I can see that rfc1867 (the RFC you implement) > says: > > The original local file name may be supplied as well, either as a >> 'filename' parameter either of the 'content-disposition: form-data' >> header or in the case of multiple files in a 'content-disposition: >> file' header of the subpart. The client application should make best >> effort to supply the file name; if the file name of the client's >> operating system is not in US-ASCII, the file name might be >> approximated or encoded using the method of RFC 1522. This is a >> convenience for those cases where, for example, the uploaded files >> might contain references to each other, e.g., a TeX file and its .sty >> auxiliary style description. > > > So the filename parameter value should not be decoded without any > mechanism but US-ASCII or the method described in RFC 1522 (encoded > words), but you just decode it with a custom 'headerEncoding'. So please > any clarification would be useful to me, why are you processing headers > like that? > > Take a look at this issue too and see if you can reopen it: > > https://issues.apache.org/jira/browse/FILEUPLOAD-56#comment-13597224 > > > PS: Chrome and Firefox browsers doesn't seem to follow this spec neither > as they encode 'filename' parameter (from a multipart/form-data) with the > page encoding (or form accept-charset), thus producing headers with raw > UTF-8 or any encoding choosen for the page in some cases. > > > > -- > Jaime Hablutzel - RPC 987608463 > -- Jaime Hablutzel - RPC 987608463 --e89a8f64337298f43c04d7b02056--