Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7F9D1E3C8 for ; Thu, 7 Mar 2013 22:15:13 +0000 (UTC) Received: (qmail 70025 invoked by uid 500); 7 Mar 2013 22:15:12 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 69950 invoked by uid 500); 7 Mar 2013 22:15: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 69936 invoked by uid 99); 7 Mar 2013 22:15:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2013 22:15:12 +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 (nike.apache.org: domain of hablutzel1@gmail.com designates 74.125.82.50 as permitted sender) Received: from [74.125.82.50] (HELO mail-wg0-f50.google.com) (74.125.82.50) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2013 22:15:05 +0000 Received: by mail-wg0-f50.google.com with SMTP id es5so1745612wgb.17 for ; Thu, 07 Mar 2013 14:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=FzStpu5doWABXjJxxIOew+TNcXcjb/ksQ1O9kX/18q0=; b=hl6C39tUPIGzWHI4eNNhwVkU/bwB5L+T5k3PWKVeVpc7WmJ5+AovPpfY5/jD1gFuNj HK0yT+OLWvs6o/YVKCmDpszrxKZspqyHTyzMvDshVor2J5NBSIe70sEcd/E4ip43ZkzX evJeNUtg+eyg7Y09K56zSGwsTtiGV7doTJeivI9+iC2twjfyRgkHRgEGpJA1KW7m8qIw iE+kQ19A8PxugLg9B4HKpACz2qQH+R+WLVPu5wvcKwSAfW1hyefCcEVKy7UEls2eXyjC H9nAVa+rySfBST7pUuWC9Fci6SWsxOw9KiyC+VANURTHiXnf9FZb/RU6+tfqsDjmIiYO eHJw== X-Received: by 10.194.109.35 with SMTP id hp3mr57910944wjb.15.1362694485229; Thu, 07 Mar 2013 14:14:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.5.6 with HTTP; Thu, 7 Mar 2013 14:14:25 -0800 (PST) From: Jaime Hablutzel Egoavil Date: Thu, 7 Mar 2013 17:14:25 -0500 Message-ID: Subject: [fileupload] Expected encoding for Content-disposition 'filename' parameter To: user@commons.apache.org Content-Type: multipart/alternative; boundary=089e010d8574bacaaa04d75d087f X-Virus-Checked: Checked by ClamAV on apache.org --089e010d8574bacaaa04d75d087f Content-Type: text/plain; charset=ISO-8859-1 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? PS: Chrome browser doesn't seem to follow this spec neither as it does encode 'filename' parameter (from a multipart/form-data) with the page encoding, thus producing headers with raw UTF-8 or any encoding choosen for the page in some cases. -- Jaime Hablutzel - RPC 987608463 --089e010d8574bacaaa04d75d087f--